Wallify

Create a Paywall

Accept USDC payments. No signup required.

Direct link to your file (PDFs, ZIP, images, etc.)

🔒 Protected file? Add auth header (optional)

Example: Authorization / Bearer your-token-here

$

How long buyers can redownload without paying again

Documentation

Everything You Need

Complete guide to paywalls, subscriptions, and API integration

Integrate in Minutes

Our REST API works with any CMS. Generate a key, POST content, embed the widget.

🔑
Wallet-bound keys - every paywall pays you directly
📦
Returns ready-to-use HTML snippets
⚡
No database required - serverless native
View API Docs
create-paywall.js
const res = await fetch('/api/v1/paywalls', {
  method: 'POST',
  headers: { 'X-API-Key': key },
  body: JSON.stringify({
    title: 'Premium Article',
    priceUSD: 2.99,
    embedContent: html
  })
});

📁 1. File & URL Redirect Paywalls

How It Works

  • • You host the file - On your own server, Google Drive, AWS S3, Dropbox, etc.
  • • ⚠️ Use direct file URLs - The URL must end with the file extension (e.g., .pdf, .zip). Don't use redirect URLs or landing pages.
  • • Buyer pays USDC - Directly to your wallet on Base or Polygon
  • • We proxy the download - After payment verification, we fetch and serve the file
  • • We never touch funds - Payment goes directly wallet-to-wallet

Protected Files (Auth Headers)

If your file requires authentication (private S3 bucket, API-protected endpoint), you can add a custom header:

  • • Authorization: Bearer your-token
  • • X-API-Key: your-api-key
  • • Authorization: Basic base64encoded

⚠️ The auth header is encrypted in the paywall URL. Only our server can decrypt it to fetch your file.

Limits & Hosting

  • • No file size limit - We stream the file, not buffer it
  • • Any file type - PDFs, ZIPs, videos, images, archives
  • • You're responsible for hosting - We just proxy after payment
  • • Redownload access - Configurable (24h, 7d, 30d, or disabled)

What Buyers See

Before paying, buyers can verify the file exists:

  • • ✓ Available - File exists and is accessible
  • • File type - PDF, ZIP, Image, Video, etc.
  • • File size - Displayed in KB/MB/GB
  • • ⚠️ Could not verify - Protected or temporarily unavailable

📝 2. Embedded Content

How Embedding Works

Perfect for premium articles, tutorials, or any HTML content:

  • • Server-side protection - Content only served after payment is verified on-chain
  • • Widget injection - Add a single div, content appears after payment
  • • Up to 25MB - Per piece of content

Using the Widget

After creating an embed paywall, you get a snippet like this:

<script src="https://paywalled.xyz/widget.js"></script>
<div class="wallify-paywall" 
     data-slug="YOUR_SLUG" 
     data-title="Premium Article" 
     data-price="2.99">
</div>

The widget replaces itself with the paywall UI, and then with content after payment.

🔑 3. Subscriptions

How Subscriptions Work

  • • Linked by wallet address - All paywalls with the same publisher wallet share subscription access
  • • Time-based access - 7, 30, 90, 180, or 365 days
  • • Auto-detected - Widget checks for existing subscription before showing paywall
  • • Token-based - Subscribers receive a cryptographic token

Token System

When a user subscribes, they receive a token like sub_abc123...

  • • Stored in browser - localStorage, keyed by publisher wallet
  • • Verified server-side - Token cryptographically validated on each content request
  • • Portable - User can copy token to use on another device
  • • Auto-expires - Token includes expiration timestamp

Publisher Setup

Two-step process:

  1. 1 Create ONE subscription paywall - This is your "Subscribe" button that generates tokens
  2. 2 Create embed paywalls for each article - Use the SAME wallet address. Widget auto-shows subscription option.

User Experience

When viewing any paywalled article:

  • • Unlock Content button - Pay for this article only
  • • Subscribe button - Pay once, unlock ALL articles (shown only if subscription is offered)
  • • "I have a subscription" link - Enter existing token

⚙️ 4. API & CMS Integration

Step 1: Generate API Key

Your API key is bound to your wallet - all paywalls pay to that wallet:

curl -X POST https://paywalled.xyz/api/v1/generate-key \
  -H "Content-Type: application/json" \
  -d '{"walletAddress": "0xYourWallet..."}'  

# Response:
{
  "success": true,
  "apiKey": "YOUR_API_KEY",
  "walletAddress": "0xyourwallet..."
}

Step 2: Create Paywalls via API

curl -X POST https://paywalled.xyz/api/v1/paywalls \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Premium Article",
    "priceUSD": 2.99,
    "embedContent": "<h1>Your premium content</h1><p>HTML here...</p>"
  }'

# Response:
{
  "success": true,
  "slug": "abc123...",
  "paywallUrl": "https://paywalled.xyz/pay/abc123",
  "widgetSnippet": "<script src='https://paywalled.xyz/widget.js'></script>..."
}

WordPress Integration (Step-by-Step)

Add this to your theme's functions.php:

// Step 1: Add the Wallify widget script to your header
add_action('wp_head', function() {
    echo '<script src="https://paywalled.xyz/widget.js"></script>';
});

// Step 2: Create a shortcode for paywalled content
function wallify_paywall_shortcode($atts, $content = null) {
    $atts = shortcode_atts([
        'title' => get_the_title(),
        'price' => '2.99',
    ], $atts);
    
    // Your API key (store securely, e.g., in wp-config.php)
    $api_key = defined('WALLIFY_API_KEY') ? WALLIFY_API_KEY : '';
    
    if (empty($api_key)) {
        return '<p>Wallify not configured</p>';
    }
    
    // Create paywall via API
    $response = wp_remote_post('https://paywalled.xyz/api/v1/paywalls', [
        'headers' => [
            'X-API-Key' => $api_key,
            'Content-Type' => 'application/json',
        ],
        'body' => json_encode([
            'title' => $atts['title'],
            'priceUSD' => floatval($atts['price']),
            'embedContent' => do_shortcode($content),
        ]),
    ]);
    
    if (is_wp_error($response)) {
        return '<p>Error creating paywall</p>';
    }
    
    $result = json_decode(wp_remote_retrieve_body($response), true);
    
    if (!isset($result['slug'])) {
        return '<p>Error: ' . ($result['error'] ?? 'Unknown') . '</p>';
    }
    
    // Return the widget div
    return sprintf(
        '<div class="wallify-paywall" data-slug="%s" data-title="%s" data-price="%s"></div>',
        esc_attr($result['slug']),
        esc_attr($atts['title']),
        esc_attr($atts['price'])
    );
}
add_shortcode('wallify', 'wallify_paywall_shortcode');
Usage in WordPress:
[wallify price="4.99" title="Premium Guide"]
<h2>This is premium content</h2>
<p>Only visible after payment...</p>
[/wallify]
Add to wp-config.php:
define('WALLIFY_API_KEY', 'your-api-key-here');

API Reference with Examples

POST https://paywalled.xyz/api/v1/generate-key

Generate an API key for your wallet

{"walletAddress": "0x..."}
POST https://paywalled.xyz/api/v1/paywalls

Create a new paywall (requires X-API-Key header)

{"title": "...", "priceUSD": 2.99, "embedContent": "<html>..."}
GET https://paywalled.xyz/api/paywall-info/:slug

Get paywall metadata (title, price, publisher)

POST https://paywalled.xyz/api/subscribe/verify

Verify a subscription token

{"slug": "...", "token": "sub_..."}

💡 Pro Tips

  • • Cache slugs - Store generated slugs in your CMS to avoid recreating paywalls
  • • Use same wallet - All paywalls with same wallet share subscriptions
  • • Webhook-ready - Payment verification returns txHash for your records