AI PurposerAI Purposer
API Docs

How the app's backend works

A practical reference for the live API routes that power generation and subscription flows.

Generation endpoint

POST /api/generate

Accepts source text and selected platforms, then returns generated outputs for each destination.

PayPal confirmation

POST /api/paypal-confirm

Verifies completed orders, validates amount, and stores subscription status for the signed-in user.

Subscription callbacks

POST /api/subscription and /api/paypal-webhook

Handles plan state changes and event callbacks from PayPal so billing state stays in sync.

Auth model

Authentication is handled with Supabase, while access and subscription data stay server-checked.

Billing model

Payment flow uses PayPal, with the site validating prices before unlocking paid access.

Routing

Production routing is handled by Vercel rewrites so the public paths stay clean.