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

# Introduction

> Task-focused, copy-paste guides for shipping payments, subscriptions, usage billing, and AI agent monetization with Macropay.

Reference docs tell you what every field does. Guides tell you how to ship a specific outcome — a working checkout, a metered AI product, a subscription upgrade flow — without stitching the pieces together yourself.

Each guide is self-contained: a concrete scenario, the exact API calls and SDK snippets, and the result you should see at the end. Because Macropay is your [merchant of record](/merchant-of-record/introduction), most of these flows also mean sales tax, VAT, and PCI scope are handled for you — you wire up the product, we handle the seller-of-record obligations.

## Start here

New to Macropay? These three cover the path from zero to your first live payment.

<CardGroup cols={3}>
  <Card title="Quickstart" icon="rocket" href="/guides/quickstart">
    Create a product and take your first payment end to end
  </Card>

  <Card title="Checkout sessions" icon="cart-shopping" href="/guides/create-checkout-session">
    Spin up a hosted, PCI-compliant checkout from the API
  </Card>

  <Card title="Webhooks" icon="bell" href="/guides/webhooks">
    Receive and verify lifecycle events in your backend
  </Card>
</CardGroup>

## Pick a guide by what you're building

### Frameworks & SDKs

Drop Macropay into your existing stack with a framework adapter or a typed SDK.

<CardGroup cols={2}>
  <Card title="Next.js" icon="react" href="/guides/nextjs">
    Wire checkout, the customer portal, and webhooks into a Next.js app
  </Card>

  <Card title="Laravel" icon="laravel" href="/guides/laravel">
    Integrate billing into a Laravel application
  </Card>

  <Card title="Python" icon="python" href="/guides/python">
    Use the Python SDK to manage products, checkouts, and orders
  </Card>

  <Card title="Encore" icon="code" href="/guides/encore">
    Add Macropay to an Encore backend
  </Card>
</CardGroup>

### AI & agent billing

Monetize models and autonomous agents by usage, activity, or verified outcome — Macropay tracks the AI cost behind each call so you can see margin, not just revenue.

<CardGroup cols={2}>
  <Card title="AI billing" icon="robot" href="/guides/ai-billing">
    Meter token usage, bill per outcome, and route calls through the AI proxy
  </Card>

  <Card title="Grant credits after purchase" icon="coins" href="/guides/grant-meter-credits-after-purchase">
    Top up a customer's prepaid usage balance once an order completes
  </Card>

  <Card title="Grant credits before purchase" icon="gift" href="/guides/grant-meter-credits-before-purchase">
    Seed trial or free-tier credits before a customer pays
  </Card>

  <Card title="Automate link sharing" icon="link" href="/guides/automate-post-purchase-link-sharing">
    Deliver a resource link automatically after a successful purchase
  </Card>
</CardGroup>

### Subscriptions & plan changes

Handle the lifecycle most billing bugs hide in: upgrades, downgrades, proration, and seats.

<CardGroup cols={2}>
  <Card title="Subscription upgrades" icon="arrow-up" href="/guides/subscription-upgrades">
    Move a customer to a higher plan and charge correctly
  </Card>

  <Card title="Subscription downgrades" icon="arrow-down" href="/guides/subscription-downgrades">
    Schedule a step-down so it takes effect at the period boundary
  </Card>

  <Card title="Proration" icon="scale-balanced" href="/guides/proration-for-subscription-changes">
    Control how mid-cycle plan changes are credited and charged
  </Card>

  <Card title="Seat-based pricing" icon="users" href="/guides/seat-based-pricing">
    Bill per seat and keep counts in sync as a team grows
  </Card>

  <Card title="Multiple subscriptions" icon="layer-group" href="/guides/allow-multiple-subscriptions-per-customer">
    Let one customer hold more than one active subscription
  </Card>

  <Card title="Migrate seats to members" icon="arrow-right-arrow-left" href="/guides/migrate-seat-based-to-member-model">
    Move an existing seat-based plan onto the member model
  </Card>
</CardGroup>

### Checkout & customer experience

Tune what buyers and existing customers see — branding, product order, and self-serve management.

<CardGroup cols={2}>
  <Card title="Customer portal" icon="user-gear" href="/guides/customer-portal">
    Give customers self-serve invoices, upgrades, and cancellations
  </Card>

  <Card title="Theme switching" icon="palette" href="/guides/theme-switch-in-checkout">
    Match checkout to your brand's light and dark themes
  </Card>

  <Card title="Order products in checkout" icon="list-ol" href="/guides/customize-products-order-in-checkouts">
    Control the sequence products appear in
  </Card>

  <Card title="Order benefits in checkout" icon="list-check" href="/guides/customize-benefits-order-in-checkouts">
    Reorder the entitlements shown to buyers
  </Card>

  <Card title="Product variants" icon="boxes-stacked" href="/guides/create-variants">
    Offer multiple variants of a single product
  </Card>

  <Card title="Lock the email field" icon="lock" href="/guides/disable-email-editing-in-checkout">
    Prevent buyers from editing a pre-filled email at checkout
  </Card>
</CardGroup>

### Account & operations

Org setup, merchant-side housekeeping, and scheduled jobs.

<CardGroup cols={2}>
  <Card title="Multiple organizations" icon="building" href="/guides/create-multiple-organizations">
    Run several brands or businesses from one account
  </Card>

  <Card title="Change merchant email" icon="envelope" href="/guides/change-email-as-merchant">
    Update the email on your merchant account
  </Card>

  <Card title="Restrict portal changes" icon="ban" href="/guides/disable-subscription-changes-in-customer-portal">
    Disable subscription edits in the customer portal
  </Card>

  <Card title="Schedule downgrades with QStash" icon="clock" href="/guides/schedule-subscription-downgrades-qstash">
    Trigger a delayed downgrade with a scheduled job
  </Card>
</CardGroup>

<Tip>
  Every guide runs against the [sandbox](https://sandbox.macropay.ai) with the same API and SDKs as production — build and test the full flow before going live, with no charges and no risk.
</Tip>

## Missing a guide?

If there's a flow you'd like us to document, email [sales@macropay.ai](mailto:sales@macropay.ai) and tell us what you're trying to build.
