# Engineering Articles

> Articles about Engineering from Dodo Payments, including guides, insights, and best practices.

- **URL**: https://dodopayments.com/blogs/category/engineering

---

- [Payment Ledger Design for Billing Systems](https://dodopayments.com/blogs/payment-ledger-design): How to design a double-entry, append-only payment ledger: account model, balanced postings, idempotency, reversals, settlement reconciliation, and multi-currency.
- [Idempotency Keys in Payment APIs: Prevent Double Charges](https://dodopayments.com/blogs/idempotency-keys-payment-api): How idempotency keys stop duplicate charges in payment APIs. Learn what idempotency means, how keys work, retry-safe patterns, key scope and TTL, and how to implement them correctly.
- [How to Build a Billing System for AI SaaS Products](https://dodopayments.com/blogs/build-billing-system-ai-saas): A step-by-step guide to building billing infrastructure for AI SaaS products - from choosing pricing models and metering usage to credit entitlements, subscription lifecycle, and customer-facing billing UI.
- [MCP Payments: How to Connect AI Agents to Payment Infrastructure](https://dodopayments.com/blogs/mcp-payments-ai-agents): Learn how to connect AI agents to payment APIs using the Model Context Protocol (MCP). Set up Dodo Payments' MCP server with Code Mode architecture for creating payments, managing subscriptions, and handling refunds through AI conversation.

---

**Dodo Payments** -- The billing & payments platform for AI-first companies.
[Payments](https://dodopayments.com/payments) | [Billing](https://dodopayments.com/billing) | [Distribution](https://dodopayments.com/distribution) | [Pricing](https://dodopayments.com/pricing) | [Documentation](https://docs.dodopayments.com) | [Dashboard](https://app.dodopayments.com)