Skip to content

app.billing_checkouts

TableRow level security on

Stripe Checkout sessions Atlas opened to move an org onto a paid plan (ADR 0033 decision 59). A newer checkout of the same org expires the open ones first, and waits while a completed one's subscription has not synced, so an org never pays for two subscriptions. The plan itself changes only when the webhook syncs the paid Stripe subscription (app.sync_subscription_from_stripe).

Primary key: id

Columns of app.billing_checkouts
ColumnTypeNullableDescription
iduuidNoPrimary key, UUID v7.
org_iduuidNoOwning org. A row never moves to another org.References app.organizations.id
plan_codetextNoPlan the checkout sells.References app.plans.code
billing_intervalapp.billing_intervalNoMonthly or Annual.
stripe_checkout_session_idtextNoStripe Checkout session (cs_...), unique.
livemodebooleanNoTrue for a live mode session; test mode sessions never touch live billing.
checkout_stateapp.billing_checkout_stateNoOpen, Completed or Expired, as Stripe reports it; Expired also when a newer checkout of the org closed it.
expires_attimestamp with time zoneNoWhen Stripe expires the session if nobody completes it.
finished_attimestamp with time zoneYesWhen the session completed or expired; null while it is open.
created_attimestamp with time zoneNoWhen the row was inserted. Set by the database.
created_byuuidYesPerson who inserted the row, or null for a platform process. Set by the database.References app.people.id
updated_attimestamp with time zoneNoWhen the row last changed. Set by the database.
updated_byuuidYesPerson who last changed the row, or null for a platform process. Set by the database.References app.people.id
deleted_attimestamp with time zoneYesSoft delete time. A row with deleted_at set is ignored by every access helper.