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

# Payments Overview

> Subscription billing with provider adapters.

# Payments overview

ShipFree uses an adapter-based payment system with a shared interface and multiple providers: **Stripe**, **Polar**, **Lemon Squeezy**, and **Creem**.

## Key files

* `src/config/payments.ts` defines plans and pricing
* `src/lib/payments/service.ts` resolves the active adapter
* `src/lib/payments/types.ts` defines shared interfaces
* `src/app/api/payments/*` exposes checkout, portal, and subscription routes
* `src/app/api/webhooks/payments/route.ts` handles provider webhooks

## API routes

* `POST /api/payments/checkout` creates a checkout session
* `POST /api/payments/portal` creates a customer portal session
* `GET /api/payments/subscription` returns the current user subscription

## Database tables

The payment system writes to these tables in `src/database/schema.ts`:

* `customer`
* `subscription`
* `payment`

<Info>
  The active payment provider is selected with `PAYMENT_PROVIDER`. Use `BILLING_ENABLED` to gate access to paid features.
</Info>
