Integrating Payment & Accounting APIs: Lessons From Production
Wiring up a payment API in a demo takes an afternoon. Running it in production — where money is real and customers are watching — is a different discipline. After integrating Stripe, Square, QuickBooks, and crypto gateways across dozens of projects, here's what actually matters.
Webhooks are the source of truth, not the API response
A successful checkout response doesn't mean payment captured. Always reconcile against the webhook, and make your webhook handler idempotent — providers retry, and you'll receive duplicates.
charge.succeeded → mark paid (idempotent on event id)
charge.refunded → reverse
invoice.payment_failed → dunning flow
Never trust amounts from the client
Recompute totals server-side before charging. The client sends intent; the server decides money.
Reconciliation is a feature, not a chore
On accounting integrations like our QuickBooks sync, the value isn't "it sends an invoice" — it's that the books match the bank at the end of every month, automatically. Build a reconciliation report from day one.
Fail loudly, recover gracefully
Queue financial operations, retry with backoff, and alert a human when retries exhaust. Silent failures in payment flows erode trust fast.
Need a payment or accounting integration done right? We've shipped this before.