Visit APIToGo on LinkedIn
  • Documentation
  • Components
  • Themes
Quickstart
CLI
MCP
Configuration
Look and feel
Writing
Guides
    Set up Stripe for paid plansYour customers' account pages
Deployment
powered by apitogo
Guides

Set up Stripe for paid plans

A plan with a price is paid through your own Stripe account. apitogo deploy needs two things from Stripe:

WhatStarts withWhat it does
Secret keysk_test_ or sk_live_Lets your plans backend create checkout pages
Webhook signing secretwhsec_Lets your plans backend trust Stripe's payment news

Deploy asks for both, hidden, and stores them as project secrets. They never go into apitogo.config.json.

Start in a sandbox (Stripe's test mode). The pictures below come from one: nothing you do there charges real cards. Switch to your live account when you are ready to sell.

1. Copy the secret key

In the Stripe dashboard, open Developers › API keys. Under Standard keys, reveal the Secret key and copy it.

The API keys page with the publishable and secret keys

Use the secret key. The publishable key (pk_) cannot take payments, and deploy refuses it. A restricted key (rk_) works too, if it may write Checkout Sessions, Customers and Subscriptions.

Run deploy and paste the key when it asks:

TerminalCode
apitogo deploy # Stripe secret key (hidden):

2. Add the webhook

After a payment, Stripe sends an event to your portal's plans backend. That event is what turns a paid checkout into an active plan.

Deploy prints the address to use, for example:

Code
https://portal.<your-portal>.apitogo.com/api/v1/webhooks/stripe

In Stripe, open Workbench › Webhooks and choose Add destination.

The Event destinations list with the Add destination button

Keep Your account and the Snapshot payload style.

The first step: event destination scope and payload style

Search for and select these four events:

  • checkout.session.completed
  • customer.subscription.updated
  • customer.subscription.deleted
  • invoice.payment_failed
Selected events: the four events ticked

Choose Webhook endpoint as the destination type, then paste the address deploy printed into Endpoint URL and choose Create destination.

The Configure destination step with the endpoint URL filled in

3. Copy the signing secret

Open the new destination. Under Signing secret, reveal the secret (the eye icon) and copy it.

The destination page with its signing secret

Paste it where deploy asks:

TerminalCode
# Stripe webhook signing secret (hidden, Enter to skip):

If you skipped it, set it later and deploy the plans again:

TerminalCode
apitogo secrets set STRIPE_WEBHOOK apitogo deploy --only plans

Check it works

Run apitogo deploy --only plans again. When Stripe has sent an event, it reports:

Code
Stripe webhook: verified (last event 2 min ago, checkout.session.completed)

Buy your own plan with a Stripe test card, such as 4242 4242 4242 4242, to send the first event.

Going live

Live mode has its own keys and its own webhooks. Switch to your live account in Stripe, repeat the three steps there, and set the new values:

TerminalCode
apitogo secrets set STRIPE_API_KEY apitogo secrets set STRIPE_WEBHOOK apitogo deploy --only plans

Selling paid plans needs the Starter or Professional hosting plan. See Gateway plans.

Last modified on November 10, 2026
Static FilesYour customers' account pages
On this page
  • 1. Copy the secret key
  • 2. Add the webhook
  • 3. Copy the signing secret
  • Check it works
  • Going live