Billing and paid organizations
shithub's first paid surface is organization billing. This document records the product and engineering contract that the PAYMENTS sprint series implements.
The current implementation already has the important shape for paid
organizations: orgs.plan is an enum with free, team, and
enterprise; organizations own repositories; organization members and
teams exist; branch protection and PR review gates exist; Actions has
schema for org/repo secrets, variables, and artifacts. Billing must
turn that substrate into a fair hosted service without taxing
public/open-source collaboration.
Product contract
As of 2026-05-12, GitHub's public pricing page presents Free at
$0, Team at $4/user/month, and Enterprise starting at
$21/user/month. shithub follows the same mental model but removes
Copilot/AI promises from the paid-org offering.
Initial decisions:
- Free organizations remain self-serve.
- Team is
$4per active organization member per month. - Active organization members, including owners, count as paid seats.
- Team has no launch trial.
- Enterprise is a visible contact-sales stub, not self-serve.
- Stripe Billing is the first payment processor.
- PayPal, manual invoices, SAML, SCIM, LDAP, enterprise account hierarchy, and contracts are deferred.
- Self-serve organization creation presents
/organizations/planas the canonical plan selector. Choosing Team creates the organization and immediately redirects the owner to hosted Stripe Checkout.
The fairness rule is explicit: public/open-source collaboration should stay generous. Paid gates focus on private collaboration, hosted cost, advanced organization controls, and support expectations.
Pricing copy rules
Pricing and onboarding pages must describe only features shithub can actually deliver on the hosted service. Before changing pricing copy, refresh the official GitHub pricing source and the Stripe Billing docs because both are time-sensitive inputs.
Rules for paid-org copy:
- Do not mention Copilot, AI agents, AI code review, or AI quotas.
- Do not promise SAML, SCIM, LDAP, managed users, audit exports, data residency, compliance attestations, contracts, or custom support until the matching implementation sprint ships.
- Do not advertise Packages, Pages, Wikis, Projects, Actions minutes, or storage quotas until those surfaces have enforcement and usage accounting.
- Use upgrade language for unavailable Team features instead of hiding existing data. Downgrades preserve configuration and make gated settings read-only where possible.
- Keep public/open-source collaboration generous in both copy and enforcement. Avoid copy that makes public repositories feel like a second-class Free tier.
- Enterprise is a contact-sales stub in v1. It should collect interest without promising contractual features.
Entitlement matrix
| Capability | Free | Team | Enterprise stub |
|---|---|---|---|
| Public org repositories | Included | Included | Contact sales |
| Basic private org repositories | Included | Included | Contact sales |
| Org members and invitations | Included | Billed by active member | Contact sales |
| Visible teams | Included | Included | Contact sales |
| Secret teams | Upgrade | Included | Contact sales |
| Basic branch protection | Included | Included | Contact sales |
| Advanced private-repo branch protection | Upgrade | Included | Contact sales |
| Required reviewers on private org repos | Upgrade | Included | Contact sales |
| CODEOWNERS review | Deferred | Deferred | Deferred |
| Org-level Actions secrets | Upgrade | Included | Contact sales |
| Org-level Actions variables | Upgrade | Included | Contact sales |
| Actions minutes | Low quota once metered | Higher quota once metered | Contact sales |
| Actions artifacts/storage | Low quota once metered | Higher quota once metered | Contact sales |
| Packages storage | Deferred until Packages is active | Deferred until Packages is active | Deferred |
| Pages/Wikis/Projects | Do not promise until shipped | Do not promise until shipped | Deferred |
| Audit log export | Deferred | Deferred | Later Enterprise feature |
| SAML/SCIM/managed users | Deferred | Deferred | Later Enterprise feature |
| Data residency/compliance | Deferred | Deferred | Later Enterprise feature |
| Billing support | Basic instance support | Billing support after runbook exists | Contact sales |
Current capability audit
Already present and safe to gate:
- Organizations with
planandbilling_email. - Organization members, owner role, and invitations.
- Teams, including
privacy='secret'. - Branch protection rules and required review counts.
- PR review and reviewer-request substrate.
- Org/repo Actions secrets and variables schema.
Present but missing enforcement or metering:
- Storage quota type exists, but quota persistence and enforcement are incomplete.
- Actions minutes, artifacts, and object usage need accounting before paid limits can be promised.
- Packages storage cannot be sold until the Packages sprint is active and quota enforcement exists.
Deferred:
- SAML, SCIM, LDAP, enterprise account hierarchy, audit-log export, data residency, compliance promises, and custom support SLAs.
- Copilot/AI features are intentionally outside shithub's paid-org product.
Billing architecture
Stripe is the payment source of truth. shithub is the entitlement source of truth.
The billing implementation should add a local billing domain that stores only Stripe IDs and payment summaries, never card data. Webhooks update local subscription state after signature verification. Policy and request handlers read local billing/entitlement state and must not call Stripe in hot paths.
Required local concepts:
- Stripe customer per billable organization.
- Subscription state per organization.
- Subscription item ID for seat quantity sync.
- Immutable webhook receipts with unique provider event IDs.
- Invoice/payment summaries for UI.
- Seat snapshots for auditability.
- Billing grace/lock state derived from processed subscription events.
PAYMENTS SP02 adds these as local database tables:
org_billing_statesstores the organization billing projection used by entitlement checks.billing_seat_snapshotsrecords active and billable seat counts over time.billing_invoicesstores invoice/payment summaries for billing UI.billing_webhook_eventsstores immutable provider event receipts for idempotent webhook processing.
New organizations receive a Free billing state from a database trigger,
and the migration backfills existing organizations as Free. Subscription
snapshot writes also keep orgs.plan synchronized as the
human-facing summary.
PAYMENTS SP03 adds the first Stripe operator contract:
billing.enabled=falsekeeps paid-org flows disabled while retaining the local billing tables.billing.stripe.secret_key,billing.stripe.webhook_secret, andbilling.stripe.team_price_idare required before Stripe routes are mounted.- Checkout success, Checkout cancel, and Billing Portal return URLs may
be overridden explicitly; otherwise the web layer derives absolute
organization URLs from
auth.base_url. billing.grace_periodcontrols how long failed-payment states may remain unlocked before paid entitlements are cut off.- When billing routes are mounted,
/settings/organizationslinks owner-managed organizations to their billing page's plan comparison. When billing is disabled, that action stays visibly unavailable instead of linking to an unmounted route.
The operator enablement flow is documented in
runbooks/stripe-billing.md.
PAYMENTS SP04 adds the self-serve onboarding flow:
/organizations/planis the canonical plan picker.- Free setup creates the organization locally without Stripe.
- Team setup creates the organization, creates or reuses the Stripe customer, counts billable seats, and redirects directly to hosted Stripe Checkout.
- Checkout success and cancel returns render shithub pages. Success tells the owner that activation waits for webhook processing; cancel keeps the organization on Free and offers a retry path.
Entitlement architecture
Paid feature checks must live behind a central entitlement package, not
as scattered orgs.plan checks in handlers.
make lint-org-plan enforces this boundary. Schema/sqlc plumbing may
store and scan the plan value, but product behavior should ask the
entitlement package whether a feature key is available.
Expected feature keys:
org.secret_teamsorg.advanced_branch_protectionorg.required_reviewersorg.actions_org_secretsorg.actions_org_variablesorg.private_collaboration_limitorg.storage_quotaorg.actions_minutes_quota
Authorization and entitlement are separate gates. A user must have both
the policy permission and the paid entitlement for gated writes. Denials
must preserve existing policy.Maybe404 behavior where existence leaks
matter.
Downgrade behavior
Downgrades must preserve customer data. Moving from Team to Free should not delete teams, secrets, variables, branch rules, or review settings. Existing gated resources become read-only where possible. Users can remove gated configuration, but cannot create or expand it until the organization upgrades again.
Open questions for implementation
- Whether Free should limit private org collaborators before usage metering exists, or whether the first paid gates are advanced controls only.
- Whether required reviewers are gated only for private org repos. The current lean is private-org-only.
- Whether org-level Actions secrets and variables should be Team-only even for public repositories. The current lean is yes for org scope.
- Exact Free and Team quota numbers for Actions and storage. These must come from real host-cost estimates before SP08.
Source references
- GitHub pricing:
https://github.com/pricing - GitHub plans docs:
https://docs.github.com/en/get-started/learning-about-github/githubs-plans - Stripe Billing:
https://docs.stripe.com/billing - Stripe pricing models:
https://docs.stripe.com/products-prices/pricing-models
View source
| 1 | # Billing and paid organizations |
| 2 | |
| 3 | shithub's first paid surface is organization billing. This document |
| 4 | records the product and engineering contract that the PAYMENTS sprint |
| 5 | series implements. |
| 6 | |
| 7 | The current implementation already has the important shape for paid |
| 8 | organizations: `orgs.plan` is an enum with `free`, `team`, and |
| 9 | `enterprise`; organizations own repositories; organization members and |
| 10 | teams exist; branch protection and PR review gates exist; Actions has |
| 11 | schema for org/repo secrets, variables, and artifacts. Billing must |
| 12 | turn that substrate into a fair hosted service without taxing |
| 13 | public/open-source collaboration. |
| 14 | |
| 15 | ## Product contract |
| 16 | |
| 17 | As of 2026-05-12, GitHub's public pricing page presents Free at |
| 18 | `$0`, Team at `$4/user/month`, and Enterprise starting at |
| 19 | `$21/user/month`. shithub follows the same mental model but removes |
| 20 | Copilot/AI promises from the paid-org offering. |
| 21 | |
| 22 | Initial decisions: |
| 23 | |
| 24 | - Free organizations remain self-serve. |
| 25 | - Team is `$4` per active organization member per month. |
| 26 | - Active organization members, including owners, count as paid seats. |
| 27 | - Team has no launch trial. |
| 28 | - Enterprise is a visible contact-sales stub, not self-serve. |
| 29 | - Stripe Billing is the first payment processor. |
| 30 | - PayPal, manual invoices, SAML, SCIM, LDAP, enterprise account |
| 31 | hierarchy, and contracts are deferred. |
| 32 | - Self-serve organization creation presents `/organizations/plan` as |
| 33 | the canonical plan selector. Choosing Team creates the organization |
| 34 | and immediately redirects the owner to hosted Stripe Checkout. |
| 35 | |
| 36 | The fairness rule is explicit: public/open-source collaboration should |
| 37 | stay generous. Paid gates focus on private collaboration, hosted cost, |
| 38 | advanced organization controls, and support expectations. |
| 39 | |
| 40 | ## Pricing copy rules |
| 41 | |
| 42 | Pricing and onboarding pages must describe only features shithub can |
| 43 | actually deliver on the hosted service. Before changing pricing copy, |
| 44 | refresh the official GitHub pricing source and the Stripe Billing docs |
| 45 | because both are time-sensitive inputs. |
| 46 | |
| 47 | Rules for paid-org copy: |
| 48 | |
| 49 | - Do not mention Copilot, AI agents, AI code review, or AI quotas. |
| 50 | - Do not promise SAML, SCIM, LDAP, managed users, audit exports, data |
| 51 | residency, compliance attestations, contracts, or custom support |
| 52 | until the matching implementation sprint ships. |
| 53 | - Do not advertise Packages, Pages, Wikis, Projects, Actions minutes, |
| 54 | or storage quotas until those surfaces have enforcement and usage |
| 55 | accounting. |
| 56 | - Use upgrade language for unavailable Team features instead of hiding |
| 57 | existing data. Downgrades preserve configuration and make gated |
| 58 | settings read-only where possible. |
| 59 | - Keep public/open-source collaboration generous in both copy and |
| 60 | enforcement. Avoid copy that makes public repositories feel like a |
| 61 | second-class Free tier. |
| 62 | - Enterprise is a contact-sales stub in v1. It should collect interest |
| 63 | without promising contractual features. |
| 64 | |
| 65 | ## Entitlement matrix |
| 66 | |
| 67 | | Capability | Free | Team | Enterprise stub | |
| 68 | | --- | --- | --- | --- | |
| 69 | | Public org repositories | Included | Included | Contact sales | |
| 70 | | Basic private org repositories | Included | Included | Contact sales | |
| 71 | | Org members and invitations | Included | Billed by active member | Contact sales | |
| 72 | | Visible teams | Included | Included | Contact sales | |
| 73 | | Secret teams | Upgrade | Included | Contact sales | |
| 74 | | Basic branch protection | Included | Included | Contact sales | |
| 75 | | Advanced private-repo branch protection | Upgrade | Included | Contact sales | |
| 76 | | Required reviewers on private org repos | Upgrade | Included | Contact sales | |
| 77 | | CODEOWNERS review | Deferred | Deferred | Deferred | |
| 78 | | Org-level Actions secrets | Upgrade | Included | Contact sales | |
| 79 | | Org-level Actions variables | Upgrade | Included | Contact sales | |
| 80 | | Actions minutes | Low quota once metered | Higher quota once metered | Contact sales | |
| 81 | | Actions artifacts/storage | Low quota once metered | Higher quota once metered | Contact sales | |
| 82 | | Packages storage | Deferred until Packages is active | Deferred until Packages is active | Deferred | |
| 83 | | Pages/Wikis/Projects | Do not promise until shipped | Do not promise until shipped | Deferred | |
| 84 | | Audit log export | Deferred | Deferred | Later Enterprise feature | |
| 85 | | SAML/SCIM/managed users | Deferred | Deferred | Later Enterprise feature | |
| 86 | | Data residency/compliance | Deferred | Deferred | Later Enterprise feature | |
| 87 | | Billing support | Basic instance support | Billing support after runbook exists | Contact sales | |
| 88 | |
| 89 | ## Current capability audit |
| 90 | |
| 91 | Already present and safe to gate: |
| 92 | |
| 93 | - Organizations with `plan` and `billing_email`. |
| 94 | - Organization members, owner role, and invitations. |
| 95 | - Teams, including `privacy='secret'`. |
| 96 | - Branch protection rules and required review counts. |
| 97 | - PR review and reviewer-request substrate. |
| 98 | - Org/repo Actions secrets and variables schema. |
| 99 | |
| 100 | Present but missing enforcement or metering: |
| 101 | |
| 102 | - Storage quota type exists, but quota persistence and enforcement are |
| 103 | incomplete. |
| 104 | - Actions minutes, artifacts, and object usage need accounting before |
| 105 | paid limits can be promised. |
| 106 | - Packages storage cannot be sold until the Packages sprint is active |
| 107 | and quota enforcement exists. |
| 108 | |
| 109 | Deferred: |
| 110 | |
| 111 | - SAML, SCIM, LDAP, enterprise account hierarchy, audit-log export, data |
| 112 | residency, compliance promises, and custom support SLAs. |
| 113 | - Copilot/AI features are intentionally outside shithub's paid-org |
| 114 | product. |
| 115 | |
| 116 | ## Billing architecture |
| 117 | |
| 118 | Stripe is the payment source of truth. shithub is the entitlement source |
| 119 | of truth. |
| 120 | |
| 121 | The billing implementation should add a local billing domain that stores |
| 122 | only Stripe IDs and payment summaries, never card data. Webhooks update |
| 123 | local subscription state after signature verification. Policy and |
| 124 | request handlers read local billing/entitlement state and must not call |
| 125 | Stripe in hot paths. |
| 126 | |
| 127 | Required local concepts: |
| 128 | |
| 129 | - Stripe customer per billable organization. |
| 130 | - Subscription state per organization. |
| 131 | - Subscription item ID for seat quantity sync. |
| 132 | - Immutable webhook receipts with unique provider event IDs. |
| 133 | - Invoice/payment summaries for UI. |
| 134 | - Seat snapshots for auditability. |
| 135 | - Billing grace/lock state derived from processed subscription events. |
| 136 | |
| 137 | PAYMENTS SP02 adds these as local database tables: |
| 138 | |
| 139 | - `org_billing_states` stores the organization billing projection used |
| 140 | by entitlement checks. |
| 141 | - `billing_seat_snapshots` records active and billable seat counts over |
| 142 | time. |
| 143 | - `billing_invoices` stores invoice/payment summaries for billing UI. |
| 144 | - `billing_webhook_events` stores immutable provider event receipts for |
| 145 | idempotent webhook processing. |
| 146 | |
| 147 | New organizations receive a Free billing state from a database trigger, |
| 148 | and the migration backfills existing organizations as Free. Subscription |
| 149 | snapshot writes also keep `orgs.plan` synchronized as the |
| 150 | human-facing summary. |
| 151 | |
| 152 | PAYMENTS SP03 adds the first Stripe operator contract: |
| 153 | |
| 154 | - `billing.enabled=false` keeps paid-org flows disabled while retaining |
| 155 | the local billing tables. |
| 156 | - `billing.stripe.secret_key`, `billing.stripe.webhook_secret`, and |
| 157 | `billing.stripe.team_price_id` are required before Stripe routes are |
| 158 | mounted. |
| 159 | - Checkout success, Checkout cancel, and Billing Portal return URLs may |
| 160 | be overridden explicitly; otherwise the web layer derives absolute |
| 161 | organization URLs from `auth.base_url`. |
| 162 | - `billing.grace_period` controls how long failed-payment states may |
| 163 | remain unlocked before paid entitlements are cut off. |
| 164 | - When billing routes are mounted, `/settings/organizations` links |
| 165 | owner-managed organizations to their billing page's plan comparison. |
| 166 | When billing is disabled, that action stays visibly unavailable |
| 167 | instead of linking to an unmounted route. |
| 168 | |
| 169 | The operator enablement flow is documented in |
| 170 | [`runbooks/stripe-billing.md`](./runbooks/stripe-billing.md). |
| 171 | |
| 172 | PAYMENTS SP04 adds the self-serve onboarding flow: |
| 173 | |
| 174 | - `/organizations/plan` is the canonical plan picker. |
| 175 | - Free setup creates the organization locally without Stripe. |
| 176 | - Team setup creates the organization, creates or reuses the Stripe |
| 177 | customer, counts billable seats, and redirects directly to hosted |
| 178 | Stripe Checkout. |
| 179 | - Checkout success and cancel returns render shithub pages. Success |
| 180 | tells the owner that activation waits for webhook processing; cancel |
| 181 | keeps the organization on Free and offers a retry path. |
| 182 | |
| 183 | ## Entitlement architecture |
| 184 | |
| 185 | Paid feature checks must live behind a central entitlement package, not |
| 186 | as scattered `orgs.plan` checks in handlers. |
| 187 | |
| 188 | `make lint-org-plan` enforces this boundary. Schema/sqlc plumbing may |
| 189 | store and scan the plan value, but product behavior should ask the |
| 190 | entitlement package whether a feature key is available. |
| 191 | |
| 192 | Expected feature keys: |
| 193 | |
| 194 | - `org.secret_teams` |
| 195 | - `org.advanced_branch_protection` |
| 196 | - `org.required_reviewers` |
| 197 | - `org.actions_org_secrets` |
| 198 | - `org.actions_org_variables` |
| 199 | - `org.private_collaboration_limit` |
| 200 | - `org.storage_quota` |
| 201 | - `org.actions_minutes_quota` |
| 202 | |
| 203 | Authorization and entitlement are separate gates. A user must have both |
| 204 | the policy permission and the paid entitlement for gated writes. Denials |
| 205 | must preserve existing `policy.Maybe404` behavior where existence leaks |
| 206 | matter. |
| 207 | |
| 208 | ## Downgrade behavior |
| 209 | |
| 210 | Downgrades must preserve customer data. Moving from Team to Free should |
| 211 | not delete teams, secrets, variables, branch rules, or review settings. |
| 212 | Existing gated resources become read-only where possible. Users can |
| 213 | remove gated configuration, but cannot create or expand it until the |
| 214 | organization upgrades again. |
| 215 | |
| 216 | ## Open questions for implementation |
| 217 | |
| 218 | - Whether Free should limit private org collaborators before usage |
| 219 | metering exists, or whether the first paid gates are advanced controls |
| 220 | only. |
| 221 | - Whether required reviewers are gated only for private org repos. The |
| 222 | current lean is private-org-only. |
| 223 | - Whether org-level Actions secrets and variables should be Team-only |
| 224 | even for public repositories. The current lean is yes for org scope. |
| 225 | - Exact Free and Team quota numbers for Actions and storage. These must |
| 226 | come from real host-cost estimates before SP08. |
| 227 | |
| 228 | ## Source references |
| 229 | |
| 230 | - GitHub pricing: `https://github.com/pricing` |
| 231 | - GitHub plans docs: |
| 232 | `https://docs.github.com/en/get-started/learning-about-github/githubs-plans` |
| 233 | - Stripe Billing: `https://docs.stripe.com/billing` |
| 234 | - Stripe pricing models: |
| 235 | `https://docs.stripe.com/products-prices/pricing-models` |