Stripe setup
This page is primarily for administrators and developers configuring billing.
1. Create or access a Stripe account
Section titled “1. Create or access a Stripe account”- Sign in to Stripe Dashboard.
- Confirm you can switch between test and live mode.
2. Get API keys (test and live)
Section titled “2. Get API keys (test and live)”- Open
Developers -> API keys. - Copy and store these values for both test and live mode:
- Publishable key (
pk_test_...orpk_live_...) - Secret key (
sk_test_...orsk_live_...)
3. Configure webhook endpoint
Section titled “3. Configure webhook endpoint”- Open
Developers -> Webhooks. - Create endpoint:
https://<your-domain>/api/stripe/webhook. - For local development, you can forward Stripe events to localhost using Stripe CLI.
4. Select required webhook events
Section titled “4. Select required webhook events”At minimum, subscribe to:
invoice.payment_succeededinvoice.payment_failedcustomer.subscription.updatedcustomer.subscription.deleted
5. Copy webhook signing secret
Section titled “5. Copy webhook signing secret”- Open your webhook endpoint details in Stripe.
- Copy the signing secret (
whsec_...). - Save it as
Stripe:WebhookSecretin app configuration.
6. Prepare pricing in Aisman first
Section titled “6. Prepare pricing in Aisman first”Before go-live, finish your pricing setup inside Aisman:
- Define tiers, included features, add-ons, currencies, and region-specific overrides in the pricing admin UI.
- Use the admin page as the source of truth for pricing data; Stripe products and prices are synchronized from Aisman.
- Verify which prices are tax-exclusive and which region prices are tax-inclusive before going live.
- Activate only the tiers, features, and add-ons you want customers to see.
- The pricing admin area is restricted to the master pricing role.
Avoid creating a second manual price catalog in Stripe unless you are troubleshooting a sync problem.
7. Understand checkout mode
Section titled “7. Understand checkout mode”- Aisman uses embedded Stripe Checkout inside the pricing flow.
- Automatic tax is enabled during checkout.
- Subscription checkout can include the selected tier together with supported add-ons.
- Checkout uses the embedded Stripe components experience rather than sending users to a separate hosted checkout page.
8. Add Stripe values to appsettings.json
Section titled “8. Add Stripe values to appsettings.json”Set configuration values in appsettings.json (or environment-specific secure configuration):
{ "Stripe": { "SecretKey": "sk_test_...", "PublishableKey": "pk_test_...", "WebhookSecret": "whsec_...", "Currency": "usd", "GracePeriodDays": 3 }}Do not commit real live secrets to source control.
9. Test in Stripe test mode
Section titled “9. Test in Stripe test mode”- Run checkout in test mode.
- Use Stripe test cards.
- Verify webhook delivery and app-side subscription updates.
- Confirm payment failure and retry scenarios are handled.
10. Go-live checklist
Section titled “10. Go-live checklist”Before switching to production:
- Replace all test keys with live keys.
- Confirm webhook endpoint and live signing secret.
- Sync and verify live products and prices from Aisman.
- Re-test an end-to-end purchase in live-safe conditions.
- Monitor first live events in Stripe and application logs.
Related docs
Section titled “Related docs”Aisman/Documents/stripe-setup.mdin the main application project (detailed implementation notes)- Output processing for post-agent processing workflow