---
title: "Payments playbook · Agent Wranglers"
url: https://agentwranglers.se/playbook/payments
updated: 2026-10-20
licence: "All rights reserved"
---

# Payments and billing playbook

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

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 checkout and card data, amounts and orders, payment events, subscriptions, failed payments, refunds and disputes, tax and invoices. 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 [Checkout and card data](https://agentwranglers.se/playbook/payments/checkout-and-card-data). It decides how much card security work you carry. Then read [Amounts and orders](https://agentwranglers.se/playbook/payments/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](https://agentwranglers.se/playbook/adversarial-testing/abuse-and-limits). Webhook signing and retries live in [webhooks and events](https://agentwranglers.se/playbook/api-design/webhooks-and-events). Database transactions live in the [data playbook](https://agentwranglers.se/playbook/data/transactions-and-concurrency). This playbook links to them and covers the payment side.

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers payments playbook: https://agentwranglers.se/playbook/payments`.

## Chapters

1. [Checkout and card data](https://agentwranglers.se/playbook/payments/checkout-and-card-data): Let the provider hold card data, handle 3-D Secure in every flow, keep prices on the server and test every outcome with test cards. (6 required)
2. [Amounts and orders](https://agentwranglers.se/playbook/payments/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. (5 required, 1 recommended)
3. [Payment events and reconciliation](https://agentwranglers.se/playbook/payments/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. (5 required, 1 recommended)
4. [Subscriptions](https://agentwranglers.se/playbook/payments/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. (6 required, 2 recommended)
5. [Failed payments and dunning](https://agentwranglers.se/playbook/payments/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. (3 required, 1 recommended)
6. [Refunds, disputes and fraud](https://agentwranglers.se/playbook/payments/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. (5 required, 3 recommended)
7. [Tax](https://agentwranglers.se/playbook/payments/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. (5 required, 1 recommended)
8. [Invoices and records](https://agentwranglers.se/playbook/payments/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. (6 required)

See all 50 rules on one page in the [checklist](https://agentwranglers.se/playbook/payments/checklist).
