← All posts

Guides

Integrations that survive production

Connecting two systems is easy in a demo and brutal in production. This is my field-tested map of billing, payments and fiscal integration — start with the patterns every integration shares, then drop into the area you actually need.

Most integration problems are not API problems — they are agreement problems. The moment two systems can both write the same field, you get drift, double-charges and oversold inventory. So every guide here starts from the same place: decide one source of truth per piece of data, then make every sync idempotent so a retry is harmless.

The second thread running through all of it is honesty about delivery. Webhooks are a speed optimization, not a guarantee — they get missed, duplicated and reordered. The pattern that actually ships is webhooks for the fast path plus a periodic reconciliation sweep that re-asserts the truth. That backbone does not change whether you're wiring Stripe subscriptions, a Mexican payment gateway, or a CFDI invoice.

To keep the depth navigable, the cluster is split into three focused areas — Stripe & SaaS billing, Mexico & LATAM payments, and Mexican CFDI e-invoicing. The guides below are the cross-cutting ones that sit underneath all three; pick the area that matches what you are wiring up.

Foundations & cross-cutting guides

FAQ

How is this section organized?
Three focused sub-hubs: Stripe & SaaS billing (subscriptions, usage metering, Connect, dunning, entitlements), Mexico & LATAM payments (Mercado Pago, Conekta, OXXO/SPEI, stablecoins, agent rails), and Mexican CFDI e-invoicing (CFDI 4.0, Carta Porte, complementos, SAT catalogs). The guides on this page are the cross-cutting ones — webhooks, ERP sync, agents vs automation — that apply across all three.
Should I use webhooks or polling?
Webhooks when you need near-real-time reaction and can host an endpoint; polling when the source has no push or you cannot accept inbound connections. In production you usually run both — webhooks for speed, a reconciliation poll to catch what they miss.
How do I keep two systems in sync without data fights?
Pick exactly one owner per entity (and ideally per field). The owner writes; everyone else reads. Then make every write idempotent so retries and duplicate events converge instead of corrupting state.
Should I buy a connector or build custom middleware?
Buy a connector (iPaaS) for standard flows and a mainstream stack — it is the fastest path. Build custom middleware when you have B2B logic, custom allocation, bundles, or a bespoke system the connectors do not model. A hybrid is often the right end state.