Stripe
With Stripe as your billing provider, EdgeKit keeps a read-only copy of your Stripe account’s records in your organization’s own database, and the Billing provider screens show it. See Read your billing provider’s records.
What you set up in Stripe
Section titled “What you set up in Stripe”EdgeKit connects Stripe for your organization. You create these in your own Stripe account and give them to EdgeKit. EdgeKit is never the merchant of record, does not use Stripe Connect, and never asks for your secret key.
-
A restricted key with Read permission only. EdgeKit reads your records with it. It cannot create, change or charge anything.
-
A second restricted key, if you sell through EdgeKit checkout or use the account page, with the Write permissions EdgeKit gives you. Checkout creates the buyer’s billing record and an unpaid subscription with it, which the page then confirms in Stripe.js. See Checkout with Stripe. A checkout page also asks Stripe for its tax quotes with it. The account page cancels, undoes a cancel, applies a save offer, changes the offer and replaces the card with it.
-
Your publishable key, if you use the account page or a checkout page. EdgeKit mounts Stripe’s card fields on those pages with it. It is made for the browser and is not a secret. Without it, the account page shows no card form for a user subscription billed through Stripe, and a checkout page that sells through Stripe refuses.
-
An event destination, so Stripe tells EdgeKit when a record changes:
- Payload style: Thin.
- Endpoint URL:
https://<tenant>.edgekit.ai/v1/webhooks/stripe. - Events: the list EdgeKit gives you. A thin destination cannot subscribe to every event, so a type left off the list is never read.
Then give EdgeKit the destination’s signing secret.
EdgeKit then reads your whole account once. From then on, each notification brings the one record that changed.
To roll the signing secret, give EdgeKit the new one inside Stripe’s 24-hour window, while both secrets are still accepted.
How EdgeKit handles a notification
Section titled “How EdgeKit handles a notification”A notification tells EdgeKit which record changed. EdgeKit then reads that record’s current state from Stripe and copies it, so notifications that arrive twice or out of order change nothing extra. A record is marked deleted only when Stripe says it was deleted, never because a read did not return it.
| Notification | EdgeKit answers |
|---|---|
| Signed, thin | 200 |
| Missing, invalid or stale signature | 401 |
| Body over 1 MiB | 413 |
| Signed, from a snapshot destination | 400 snapshot_event_unsupported |
| EdgeKit holds no signing secret yet | 503 |
A 200 means EdgeKit received the notification. A record type EdgeKit does not read also answers 200.
What EdgeKit reads
Section titled “What EdgeKit reads”| In Stripe | Billing provider screen and tab |
|---|---|
| Account records, what other platforms call a customer | Accounts |
| Products | Pricing: Products |
| Prices, and legacy Stripe plans | Pricing: Prices |
| Payment methods | Pricing: Payment methods |
| Coupons | Pricing: Coupons |
| Subscriptions | Subscriptions: Subscriptions |
| Subscription schedules | Subscriptions: Schedule |
Invoices (Kind Charge) and credit notes (Kind Credit) |
Invoicing: Invoices |
| Invoice lines and invoice items | Invoicing: Line items |
Charges (Payment) and refunds (Refund) |
Invoicing: Transactions |
| Tax on invoice lines | Invoicing: Tax |
Card, US bank account and SEPA Debit payment methods show their type, brand, last four and expiry. Other payment method types are listed without those details.
A disputed charge shows the status Chargeback. EdgeKit does not read disputes on their own, usage meters (the
Usage tab stays empty), connected accounts or credit grants.
Subscription status
Section titled “Subscription status”| Stripe status | Console status |
|---|---|
incomplete |
Pending |
trialing |
Trialing |
active |
Active |
past_due, unpaid |
Past due |
paused |
Paused |
canceled, incomplete_expired |
Ended |
A status Stripe adds later shows as Pending until EdgeKit maps it. Pausing payment collection does not change the
status. A subscription set to cancel, at the period end or on a date, shows Renewal Will not renew.
Checkout with Stripe
Section titled “Checkout with Stripe”Load Stripe.js on your page with your organization’s own publishable key, and mount Stripe’s Payment Element on the
clientSecret that checkout’s first call answers. The flow is in
Confirm the card with Stripe.
Checkout’s paymentMethod names what the buyer pays with: card (the default), apple_pay, google_pay, paypal
or link. With an offer token minted for no checkout page, checkout accepts any of them, and the Stripe subscription
then takes only that method, so mount the same one in Stripe.js. See
Payment method.
A checkout page offers the methods you tick on that page. Each one needs its setup in your Stripe Dashboard first: see Payment methods.
Your Content Security Policy must allow script-src https://js.stripe.com https://*.js.stripe.com,
frame-src https://js.stripe.com https://*.js.stripe.com https://hooks.stripe.com and
connect-src https://api.stripe.com.