> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shipfastai.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Stripe billing, subscriptions, and payments

> Accept payments with Stripe, manage subscriptions through the customer portal, and handle webhook events for lifecycle automation.

Shipfastai includes a ready-to-use Stripe integration for subscription billing. You can create checkout sessions that take a user directly to Stripe's hosted payment page, redirect existing subscribers to the Stripe customer portal for self-service management, and receive webhook events to keep your database in sync with Stripe's state. All billing endpoints live under `/api/billing`.

<Note>
  Shipfastai is sold as a **one-time purchase** with a **30-day money-back guarantee**. If you are not satisfied for any reason, contact support within 30 days of purchase for a full refund.
</Note>

## Creating a checkout session

To start a subscription, call `POST /api/billing/create-checkout-session` with the Stripe `price_id` for the plan the user selected. The endpoint creates a Stripe customer for the user if one does not already exist, then returns a `url` you should redirect the user to.

```json Request theme={null}
POST /api/billing/create-checkout-session
Authorization: Bearer <access_token>
Content-Type: application/json

{
  "price_id": "price_1OqABCDEFGHIJKLMNOPQRSTUV"
}
```

```json Response — 200 OK theme={null}
{
  "url": "https://checkout.stripe.com/pay/cs_test_..."
}
```

Redirect the user's browser to `url`. On successful payment, Stripe redirects to `{FRONTEND_URL}/dashboard?success=true`. On cancellation it redirects to `{FRONTEND_URL}/pricing?canceled=true`.

## Accessing the customer portal

Subscribers can manage their own subscription — upgrade, downgrade, or cancel — through the Stripe customer portal. Call `POST /api/billing/create-portal-session` to get a portal URL.

```json Request theme={null}
POST /api/billing/create-portal-session
Authorization: Bearer <access_token>
```

```json Response — 200 OK theme={null}
{
  "url": "https://billing.stripe.com/session/sess_..."
}
```

Redirect the user to that URL. When they are done, Stripe returns them to `{FRONTEND_URL}/dashboard`.

## Stripe webhooks

Configure your Stripe dashboard to send webhook events to `POST /api/billing/webhook`. The endpoint verifies the `Stripe-Signature` header using your webhook secret before processing any event.

The following events are handled automatically:

| Event                           | Effect                                                                              |
| ------------------------------- | ----------------------------------------------------------------------------------- |
| `checkout.session.completed`    | Sets `subscription_status = "active"` and `subscription_tier = "pro"` for the user. |
| `customer.subscription.updated` | Syncs the `subscription_status` field with the value from Stripe.                   |
| `customer.subscription.deleted` | Sets `subscription_status = "cancelled"` and `subscription_tier = "free"`.          |

All other events receive a `{ "received": true }` response and are ignored. Additional event types can be handled by extending the webhook handler in your own codebase.

```json Webhook payload example theme={null}
{
  "type": "checkout.session.completed",
  "data": {
    "object": {
      "metadata": { "user_id": "a1b2c3d4-..." },
      "customer": "cus_..."
    }
  }
}
```

## Pricing tiers

Shipfastai is available as three one-time-purchase tiers. All tiers include lifetime access to the codebase and one year of updates.

<Tabs>
  <Tab title="Basic — $199">
    Everything you need to launch a basic AI SaaS:

    * FastAPI + Next.js boilerplate
    * JWT authentication + OAuth (Google, GitHub)
    * Stripe subscriptions
    * Email integration (Brevo)
    * Docker Compose setup
    * Railway + Vercel deployment
    * CI/CD pipeline (GitHub Actions)
    * 1 year of updates

    [Get started →](/quickstart)
  </Tab>

  <Tab title="Pro — $299">
    For developers building AI-powered products. Includes everything in Basic, plus:

    * RAG pipeline (LangChain + FAISS)
    * Streaming LLM chat
    * AI usage metering
    * Admin dashboard
    * VectorDB abstraction (FAISS / Pinecone / Chroma)
    * LangSmith tracing
    * Pinecone integration

    [Get started →](/quickstart)
  </Tab>

  <Tab title="Enterprise — $499">
    For teams building production AI platforms. Includes everything in Pro, plus:

    * QLoRA fine-tuning scripts (PyTorch + PEFT)
    * Multi-tenancy with tenant isolation
    * Usage-based billing (Stripe metered)
    * Priority support
    * HuggingFace Transformers integration
    * Custom deployment support
    * Architecture consultation call

    [Get started →](/quickstart)
  </Tab>
</Tabs>
