All insights
02Engineering6 min

The Real Cost of Adding a Payment Market Is Exceptions, Not Endpoints

Adding another country rarely breaks your API first. It breaks the assumptions behind your payment flow.

The Real Cost of Adding a Payment Market Is Exceptions, Not Endpoints
Figure 02A. The happy path is short. Production complexity lives in retries, late confirmations, duplicate requests and settlement exceptions.

On a roadmap, adding another payment market looks simple: connect the provider, map the API, expose the method and go live. The integration itself may take days. The difficult part usually appears after production traffic begins.

A payment arrives after the checkout timer has expired. A server callback arrives before the browser redirect. A customer pays twice. A bank accepts an instruction but the final status comes later. Finance can see the money in the bank, but cannot match it cleanly to the internal order.

The expensive part is not adding another endpoint. It is modelling another market’s exceptions correctly.

Happy paths are surprisingly similar

Most modern payment integrations can be reduced to the same high-level sequence: create a transaction, receive payment instructions, present them to the customer, wait for payment, receive confirmation, update the merchant ledger and reconcile against settlement. That is why a unified API is possible.

But a process diagram describes the happy path. Payment operations are defined by everything that happens around it.

1. “Pending” is not one state

A transaction may be created but never shown to the customer. It may be shown but never authorised. The customer may complete the transfer while the merchant backend is still waiting for confirmation. A checkout may expire while the funds arrive later.

If all of those conditions are collapsed into one Pending status, the ambiguity moves into customer support, finance and risk - and eventually returns to engineering. A more resilient model separates customer-journey state from money-movement state.

2. The browser is not the source of truth

Browsers close. Mobile apps interrupt sessions. Connections drop. Users press Back. A customer returning to a success page is useful for the user experience, but it should not be treated as authoritative proof that money moved.

The interface should explain what the customer sees. The backend should determine what actually happened to the transaction. Those responsibilities should remain separate.

3. Instant confirmation does not remove reconciliation

Fast confirmation creates an intuitive expectation that reconciliation should also be instant. Operationally, they are different processes. Finance still needs to know which order generated the payment, the gross amount, fees, currency, settlement batch, adjustments and expected net amount.

Pix shows the scale at which this matters. Banco Central do Brasil reported 42.9 billion Pix transactions in the second half of 2025, representing 54.7% of payment transaction count during that period.

4. Idempotency is invisible - until it fails

Payments are one of the worst places to assume that a request happens only once. A merchant server retries. A network request times out. A user taps twice. A service restarts. Without a reliable idempotency model, a harmless retry can become a duplicate financial instruction.

5. Payouts expose localization faster than collections

Checkout receives most of the attention because it directly affects conversion. Payouts reveal a different class of localization problems: recipient identifiers, required fields, name validation, processing windows, limits, return behaviour and wallet-versus-bank differences.

For marketplaces, gaming platforms, trading businesses, creator platforms and other two-way-money businesses, a market is not fully integrated just because money can enter. It is integrated when money can enter, leave and be reconciled predictably.

Local payments should look different to customers and similar to engineers

For the customer, the goal is local familiarity. For the merchant’s engineering team, the goal is consistent technical primitives. Normalize what can safely be normalized - authentication, API structure, transaction IDs, idempotency, callbacks, signatures, status queries and reconciliation - while preserving local payment methods, instructions, identifiers, limits and payout requirements.

A sandbox proves connectivity. Production proves the model.

Sources

  1. 01Banco Central do Brasil - Payment instruments, H2 2025