Skip to content

Stripe ​

Connect your own Stripe account so customers can add credit and subscribe by card. Payments go straight to your Stripe account. MicroAuth listens to Stripe's webhooks and updates balances and plans for you.

Stripe lives under Pricing. Open it from the Stripe line at the top of the Pricing page, or from Connect Stripe when the dashboard asks for it.

You only need Stripe if you charge money. Free APIs, and APIs you bill some other way, can skip this page. See external credits for the second case.

Connect in two steps ​

1. Copy your API keys ​

Open Stripe API keys and paste:

FieldValue
Secret keyStarts with sk_live_ or sk_test_. A restricted key (rk_...) works too
Publishable keyOptional. Starts with pk_live_ or pk_test_, in the same mode as the secret key

Start with test keys while you try things out. In test mode, payments use Stripe's test cards and no real money moves. Switch to live keys with Replace keys when you are ready.

Keys are encrypted at rest and never shown again.

2. Add a webhook endpoint ​

Open Stripe webhooks and create an endpoint:

  1. Endpoint URL: copy it from the Stripe page in the dashboard. It looks like https://api.microauth.com/webhooks/stripe/<your API ID>.
  2. Events: select every event below. Copy all on the Stripe page puts the full list on your clipboard, and Show events lists them there.
  3. Signing secret: after you create the endpoint, reveal its signing secret (whsec_...) and paste it into the dashboard.
EventWhy MicroAuth needs it
checkout.session.completedCredit top-ups and new subscriptions
checkout.session.async_payment_succeededBank payments that clear later
checkout.session.expiredCloses abandoned checkouts
customer.subscription.createdNew subscriptions
customer.subscription.updatedPlan changes
customer.subscription.deletedCancellations
invoice.paidAdds plan credit each billing cycle
invoice.payment_failedStarts the payment grace period
refund.createdRemoves refunded credit
refund.updatedRefund status changes
refund.failedGives credit back when a refund fails
charge.dispute.createdRemoves disputed credit
charge.dispute.updatedDispute status changes
charge.dispute.closedGives credit back when you win a dispute

Select all fourteen

Stripe only sends the events you select. Without the refund and dispute events, money you refund stays on the customer's balance as credit.

Click Connect Stripe. Your monthly plans are created in Stripe automatically.

What customers see ​

Once Stripe is connected, your portal's Billing page lets customers:

  • Add prepaid credit through Stripe Checkout.
  • Subscribe to, or switch between, your public plans and any private plans assigned to them.
  • Open Stripe's billing portal to update a card or manage their subscription.

Credit appears on the balance as soon as Stripe confirms the payment, usually within seconds.

Failed payments ​

When a subscription payment fails, the customer gets a 7-day grace period and an email. Their plan keeps working while they update their card. If the grace period runs out, the customer is suspended for billing until a payment succeeds. Nothing is deleted. See subscription payment grace.

Replace or disconnect ​

  • Replace keys swaps in new keys and a signing secret. To move from test mode to live mode, create the webhook endpoint again in live mode (Stripe keeps test and live endpoints apart), then paste the live keys and the new signing secret.
  • Disconnect removes the keys. Customers can no longer add credit or subscribe until you connect again. Existing balances stay as they are.

Troubleshooting ​

SymptomLikely cause
A customer paid, but the balance did not changeThe endpoint is missing checkout.session.completed, or the signing secret belongs to a different endpoint
Plan credit is not added each monthinvoice.paid is not selected
A refund did not reduce the balanceThe refund.* events are not selected
Stripe shows failed deliveries with status 400The signing secret in the dashboard does not match this endpoint. Paste it again with Replace keys

MicroAuth is a product of Zyref, LLC.