Skip to content

PaperRun API Documentation

PaperRun is a postcard marketing automation platform for e-commerce. Merchants create campaigns targeting customer segments, and the platform handles recipient syncing, address enrichment, image personalization, printing, mailing, delivery tracking, and order attribution.

New Here? Use Claude Code

If you have Claude Code set up, the fastest way to get oriented is with slash commands:

/onboard-learn        # Guided walkthrough of the full system, stage by stage
/explain-domain       # Quick explainer on any domain (attribution, campaigns, printing, etc.)

For example, /onboard-learn will walk you through the architecture, trace a request through the code, explain the recipient pipeline, and cover attribution — pausing for questions at each stage.

See Claude Code Usage for all available commands.

Start Here

If you're new to the codebase, read these in order:

  1. Architecture Overview — System flow diagram, background workers, integration map
  2. Campaign — Campaign lifecycle and state machine
  3. Campaign Recipients — Recipient pipeline from sync to delivery
  4. Proofing & Mailing — How images are personalized and postcards are printed
  5. Order Syncing — How orders are synced and attributed to campaigns
  6. Attribution Methodology — Deep dive on attribution logic

Data Flows

Models

Core entities: Campaign | Recipients | Mailpiece | Organization | Orders | Attribution

Supporting: Integration | Templates | Discounts | Campaign Associations | Blocklist | Users

Guides

External Integrations

Service Purpose
Klaviyo Customer data platform — segments, profiles, order events
Shopify E-commerce — store data, orders, webhooks
Stripe Billing — usage meters, subscriptions
LOB Postcard printing and mailing — via PrinterGateway
IntelliPrint Postcard printing and mailing — via PrinterGateway
Stannp Postcard printing and mailing — via PrinterGateway
Personalization Layer Image personalization — Figma Plugin (current), Backup Generator (fallback), Pixelixe (deprecated). Rendering repo
Cloudflare Images Image hosting and resizing
Faraday Address enrichment

Slack Commands

  • /pr-hello — Simple greeting
  • /pr-orgs — List all organizations
  • /pr-org <id|name> — Organization details and audit data