Skip to main content
The Starter Kit integrates with Dev Kit for AI’s payment system to provide subscription billing for your end users. This guide covers implementing billing UI, managing subscriptions, and providing self-service payment management.

Overview

End users of your Starter Kit application can:
  • Subscribe to paid plans through Stripe Checkout
  • View their current subscription status
  • Access payment history and download invoices
  • Manage billing through the customer portal
  • Upgrade, downgrade, or cancel subscriptions

Prerequisites

Before implementing billing in your app:
1

Configure Stripe in Cloud Admin

Complete the Payment Setup & Configuration guide to add your Stripe credentials.
2

Create Stripe Products

Set up your subscription products and prices in the Stripe Dashboard. Note the Price IDs.
3

Verify Webhooks

Ensure webhook endpoints are configured and receiving events correctly.

Displaying Subscription Status

Fetch and display the user’s current subscription in your dashboard:

Server Action

Create a server action to fetch subscription status:

Subscription Status Component

Display subscription status with appropriate messaging:

Creating Checkout Sessions

Redirect users to Stripe Checkout to subscribe:

Server Action

Subscribe Button

Payment History

Display the user’s payment history:

Server Action

Payment History Component

Customer Portal Access

Let users manage their billing through Stripe’s hosted customer portal:

Server Action

Manage Billing Button

The customer portal provides users with:
  • Update payment method
  • View and download invoices
  • Cancel subscription
  • Update billing address
(((REPLACE_THIS_WITH_IMAGE: stripe-customer-portal-example.png: Stripe customer portal showing payment methods, invoices, and subscription management options)))

Subscription Management

Cancel Subscription

Allow users to cancel their subscription:

Update Subscription (Plan Change)

Allow users to upgrade or downgrade their plan:

Gating Premium Features

Check subscription status to gate premium features:
Use in pages:

Billing Page Example

Complete billing management page:
(((REPLACE_THIS_WITH_IMAGE: starter-kit-billing-page.png: Starter Kit billing page showing subscription status card, manage billing button, and payment history table)))

Next Steps

Payment Setup

Configure Stripe credentials in Cloud Admin

Monitor Payments

View subscriptions and transactions in the console

Subscription Lifecycle

Understand the complete subscription workflow

Payment API Reference

Complete endpoint documentation