Skip to content

Stripe

Subscription and metered per-device billing through Stripe.

CategoryBilling
AuthenticationSecret key
Reachesapi.stripe.com
Needs an agentNo
Demo modeYes

billing.createCheckout, billing.getSubscription, billing.portal

  1. In the Stripe dashboard, go to Developers, API keys.
  2. Copy the secret key. It starts sk_live_ in production and sk_test_ in test mode.
  3. Create the Price for your per-device plan under Products, and copy its price id, which starts price_.

Use a restricted key rather than the full secret key if you can. The permissions this connector needs are read and write on Checkout Sessions, Subscriptions and Billing Portal Sessions. A full secret key can do considerably more.

Admin, Connectors, Stripe, Configure.

FieldDefaultValue
priceIdemptyThe Stripe Price id for the per-device plan
demoModefalseReturn fixture data
FieldValue
secretKeyThe Stripe secret or restricted key

Save and test.

Stripe’s test mode is a complete parallel environment with its own keys, prices and dashboard. Configure with sk_test_ and a test price first, run a checkout end to end, and only then switch to live keys.

The most common mistake is a live key with a test price id, or the reverse. Stripe’s error for that is clear once you know to look for it.

OperationUse
Create checkoutStart a hosted payment flow
Get subscriptionRead the current subscription state
PortalOpen Stripe’s own billing portal so a customer manages their own payment method and invoices

The portal is worth using rather than building anything. Stripe’s billing portal handles card updates, invoice history and cancellation, and keeping that out of your own product is less code and less liability.

Worth being explicit, because it is the same principle that governs the vendor’s own billing.

Entitlement lives in the signed licence, not in the billing system. A payment failure does not disable a service desk. Nothing in the billing path revokes anything.

A Stripe outage, an expired card or a failed webhook is a conversation, not an outage.

SymptomCause
401 on testWrong key, or a restricted key without the needed permissions
“No such price”A test price id with a live key, or the reverse
Checkout opens but failsThe price is not active, or its currency does not match the account
Fixture data appearsdemoMode is still on