Developer Docs

Stripe Integration

Provisioning Stripe products, creating organization subscriptions, and auditing seat quantities via the ds stripe CLI.

Stripe Integration

DevStride uses Stripe for subscription billing. The ds stripe CLI (cli/commands/stripe.ts) wraps three commands for provisioning Stripe products and customers and for auditing seat-count drift between DevStride and Stripe. It is a thin operational tool, not a sync engine — each command does one specific thing, and none of them run on a schedule.

Add Products

ds stripe add-products

What It Does

Creates three Stripe products, each with a monthly and a yearly price, and a matching DevStride product record (via CreateProductCommand) with its default usage limits:

ProductMonthly / Yearly priceDefaultNotes
Professional$9.00 / $90.00100 smart suggestions, 1,000 actions, 1 GB storage
Business$24.00 / $240.00Default product1,000 smart suggestions, 300,000 actions, 5 GB storage
DevStride Free$0 / $0Marked customSame limits as Business; the plan create-customers subscribes new orgs to

When to run:

  • Bootstrapping a brand-new stage's Stripe account for the first time
  • If a stage's Stripe products need to be (re)created from scratch

In practice you rarely need to run this directly — create-customers calls it automatically the first time it finds no products, so a fresh stage bootstraps itself.

Create Customers

# Every organization that doesn't have a Stripe subscription yet
ds stripe create-customers

# A single organization
ds stripe create-customers -o <organization-id>

What It Does

For each organization (or just the one passed with -o/--organization):

  1. Finds the organization's Owner membership to use as the Stripe billing contact, falling back to an Admin if there's no Owner. If neither exists, the organization is skipped.
  2. Creates a Stripe customer for that owner/admin.
  3. Looks up DevStride's product records — if none exist yet, runs add-products first, so a completely empty Stripe account bootstraps itself on the first create-customers run.
  4. Creates a subscription on the DevStride Free product's yearly price, with the seat quantity set to the organization's current count of active members.
  5. Writes the resulting subscription (id, product/price ids, interval, limits, period dates, status, quantity) back onto the organization record.

When to run:

  • After creating a new organization outside the normal signup flow (e.g., data migration, ds data copy)
  • Backfilling Stripe customers/subscriptions for organizations that don't have one yet

Find Subscription Quantity

# Audit every organization
ds stripe find-subscription-quantity

# Audit a single organization
ds stripe find-subscription-quantity -o <organization-id>

What It Does

Compares DevStride's active member count against the seat quantity on the organization's live Stripe subscription:

  • Counts active memberships per organization. Internal @devstride.com accounts are excluded unless the organization has devStrideUsersSupport enabled.
  • Retrieves the actual subscription quantity from Stripe. If the organization's subscription can't be found on Stripe, that organization is logged to the console and skipped — it will not appear in the output.
  • Writes the results to subscription_quantity.csv in the current working directory, sorted with mismatches first, then by DevStride quantity descending.
ColumnMeaning
organizationIdOrganization UUID
organizationNameOrganization name
devstrideQuantityActive member count in DevStride
stripQuantitySeat quantity on the Stripe subscription
correcttrue if the two counts match

When to run:

  • Auditing seat-count drift across organizations (e.g., before invoicing or a billing review)
  • Investigating a single organization's billing discrepancy with -o

Next Steps