Agent Wranglers

Payments and billing playbook

Rules for taking money in a web app or SaaS through a payment provider. Checkout, orders, webhooks, subscriptions, refunds, disputes, tax and invoices.

  • Required 29
  • Recommended 45

A payments playbook for any web app, shop or SaaS that takes money through a payment provider such as Stripe, Adyen, Mollie or Paddle. It covers card security, price display and consumer law, amounts and orders, payment events, subscriptions, failed payments, refunds and disputes, tax and invoices. The last chapters cover marketplaces and payouts, currencies and settlement, and bank transfers and local payment methods. It is written for the developers and AI agents who build billing, and for owners who must trust it.

Money bugs cost twice. A double charge loses a customer, and a missed refund or a wrong invoice can break the law. Each rule here has a check that fails before a customer notices. Legal dates and limits were checked against the official texts in October 2026. This playbook is not legal or tax advice, so confirm with an accountant which rules apply to you.

Start with Card security and SCA. It decides how much card security work you carry. Then read Amounts and orders before you write any code that stores a price.

Some topics have their home elsewhere. Security tests for payments live in abuse and limits. Webhook signing and retries live in webhooks and events. Database transactions live in the data playbook. This playbook links to them and covers the payment side. Metering, credits and spend caps for usage plans live in the usage-based billing playbook.

Chapters

  1. Card security and SCA

    Let the provider hold card data, guard the scripts on payment pages, handle 3-D Secure and its exemptions, and test every outcome with test cards.

    • Required 5
    • Recommended 3
  2. Price display and consumer law

    Show the full price, label the order button, give honest discounts, never surcharge EU consumer cards and honour the EU right of withdrawal.

    • Required 7
  3. Amounts and orders

    Hold money as integers with a currency, freeze what the customer agreed to, move orders through fixed states and never charge the same order twice.

    • Required 1
    • Recommended 5
  4. Payment events and reconciliation

    Let verified provider events move orders, catch the events you missed, keep an append-only ledger and match every payout to the cent.

    • Required 2
    • Recommended 7
  5. Subscriptions

    Let the provider run renewals, give access from one status check, get clear consent, remind before charges and make cancelling as easy as signing up.

    • Required 3
    • Recommended 2
  6. Failed payments and dunning

    Retry only declines that can succeed and only on a fixed schedule. Ask the customer to fix the card, and keep saved cards current.

    • Recommended 4
  7. Refunds, disputes and fraud

    Refund through the provider once and on time, answer every dispute with evidence, watch the dispute ratio and stop card testing before it starts.

    • Required 1
    • Recommended 7
  8. Tax

    Calculate tax with a service, keep proof of where each customer is, charge EU VAT by country, check VAT numbers and watch US nexus thresholds.

    • Required 3
    • Recommended 4
  9. Invoices and records

    Number invoices without gaps, include every required field, correct with credit notes, send e-invoices where required and keep records for the legal period.

    • Required 4
    • Recommended 2
  10. Marketplaces and payouts

    Let the provider verify sellers before they sell and report their income where the law asks. Settle who pays refunds, and explain every payout.

    • Required 2
    • Recommended 4
  11. Currencies and settlement

    Set a price per currency and record the rate and settled amount of every charge. Refund in the currency paid, and convert money only once.

    • Required 1
    • Recommended 4
  12. Bank transfers and local methods

    Offer the payment methods each market uses, put a checked reference on every bank-transfer invoice and send payouts with the payee's exact name.

    • Recommended 3

Rules from regional law

Most rules here hold for every project. The rules below come from the law of one region. Follow them when your project serves people there.

European Union (EU)

United Kingdom (UK)

United States (US)

Norway (NO)

Germany (DE)

California (US-CA)

All 74 rules on one page

This is a lot to check. An Expert can check it for you.

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/payments">Agent Wranglers payments and billing playbook</a>. In code you write, add a comment next to it with the same link.