# CheapCrawler — Buy License & Checkout API

## Pricing & Volume Tiers
- Standard Rate: $189 USD / license / year
- Billing Modes: `subscription` (annual auto-renew, cancel anytime) or `one_time` (1-year license)
- Simultaneous Activations: 2 devices per license

### Volume Discount Tiers
- 1–4 licenses: $189 USD / license / year
- 5–9 licenses: $179 USD / license / year
- 10–19 licenses: $169 USD / license / year
- 20+ licenses: $159 USD / license / year

### Included Free with Every License
- 20 GB cloud backup storage (worth $10 USD for one year)
- $5 USD free AI credit (one-time welcome bonus)

## Programmatic Checkout API (`/api/agent/buy`)

### 1. Get Real-Time Quote (`GET`)
```http
GET https://cheapcrawler.com/api/agent/buy?quantity=5&billing_mode=subscription
```

### 2. Initiate Verified-Email Order (`POST`)
```http
POST https://cheapcrawler.com/api/agent/buy
Content-Type: application/json

{
  "email": "customer@company.com",
  "quantity": 1,
  "billing_mode": "subscription"
}
```

### How Email Verification & Paddle Checkout Work
1. `POST /api/agent/buy` creates a Paddle transaction with `custom_data.verified_email` locked to the requested email address.
2. The server emails a signed 1-click verification and payment link (`/buy?qty=1&email=...&vtoken=...&_ptxn=...`) to the buyer's inbox via AWS SES.
3. Clicking the emailed link automatically verifies ownership of the email address on `/buy` (skipping the 6-digit OTP code step) and opens the Paddle payment form.
4. If the buyer instead opens the public `checkout_url` (`/buy?qty=1&email=...&_ptxn=...`) directly, `/buy` verifies their email via a 6-digit OTP code before opening Paddle checkout.
5. When Paddle sends the `transaction.completed` webhook (verified via `Paddle-Signature`), license keys are issued to `custom_data.verified_email`.
