World Pay API

Global Payment API Architecture

Design one commercial payment layer across credit cards, ACH, bank transfers, stablecoins, crypto invoices, wallets, foreign exchange, and regional payout routes.

What a global payment API actually does

A global payment API connects a commercial instruction to one or more financial rails. It creates a payment intent, determines which methods are eligible, renders a rail-specific instruction, observes the result, applies risk and compliance policy, posts balanced ledger entries, notifies the merchant, and reconciles external settlement. The public API can be consistent, but the underlying rails should remain visible enough for finance, operations, and customer support.

The platform might route card authorization, ACH credit or debit, domestic bank transfer, wallet payment, stablecoin collection, crypto invoice, or regional payout. Each method has its own timing, return behavior, customer recourse, sensitive data, settlement evidence, and operational dependencies. A useful abstraction normalizes commercial concepts while preserving those rail-specific facts.

Use a canonical payment intent

The payment intent is the merchant-facing contract. It should contain a stable identifier, merchant and order references, amount, pricing currency, accepted methods, expiration, description, customer context when permitted, and fulfillment state. Route attempts sit below the intent. A shopper can try a card, move to an account transfer, or select USDC without creating unrelated orders.

Keep commercial state separate from rail state. The order may be awaiting payment while a bank transfer is submitted, a card is authorized but not captured, or a stablecoin transfer is detected but not sufficiently confirmed. Separate risk, ledger, conversion, and payout states provide the detail needed to explain and reconcile the payment without overloading one status field.

Route with policy, not a hard-coded preference

Eligibility should account for merchant configuration, payer location, beneficiary location, amount, currency, customer device, provider availability, risk, compliance, settlement preference, and actual method support. Customer choice matters. A route should not be swapped solely to improve margin if the economic terms, refund rights, data sharing, or user experience change.

Store the reason a route was offered and selected. A versioned policy record makes incidents and audits easier to investigate. It also lets teams compare actual completion, support demand, settlement time, and total cost by route rather than relying on broad assumptions about cards, bank payments, or digital assets.

Build rail adapters with declared capabilities

Every adapter should declare what it can do: authorize, capture, confirm, refund, reverse, dispute, support partial payments, attach references, sponsor fees, return funds, or settle in a specific currency. The orchestration layer uses those capabilities to create the correct instruction and status model. Unsupported behavior should fail before checkout rather than appear as a generic error after the customer acts.

Adapters translate provider payloads into normalized observations and preserve raw references for audit. Provider-specific fields belong in a metadata envelope. The public contract should not mirror one vendor so closely that adding a second route forces every merchant to re-integrate.

Put a double-entry ledger behind the API

The application database can tell you what the product believes happened. The ledger tells you what financial position was posted. Define named accounting operations for authorization holds, collection, merchant payable, fees, reserves, conversion, payout, refund, return, dispute, and adjustment. Every posted operation must balance and link to the business object and external evidence.

Do not edit history to repair a mismatch. Post a linked adjustment with a reason and approval. Reconcile ledger control accounts to processor reports, bank accounts, custody balances, and blockchain evidence. A platform cannot claim global payment coverage if finance cannot close each route accurately.

Design webhooks for recovery

Events should be durable facts with unique identifiers, object versions, creation times, and signed bodies. Delivery attempts are separate records. Merchants must be able to deduplicate events and fetch the current resource when ordering matters. The platform should be able to replay an event without creating a new financial fact.

Use clear event names such as payment detected, payment authorized, payment confirmed, payment available, payment failed, refund completed, payout returned, and dispute opened. Avoid emitting a generic success event before the merchant's fulfillment conditions are met.

Make exceptions part of the product

Global payments produce late transfers, wrong currencies, partial amounts, duplicate instructions, bank returns, card disputes, unsupported tokens, payout rejections, and foreign-exchange differences. Each exception needs a queue, owner, service target, evidence view, and safe resolution action. Manual tools should create the same ledger entries and durable events as automated paths.

Measure aged exceptions, not only aggregate volume. A payment system is healthy when discrepancies are visible and resolved predictably, not when dashboards hide them behind a green status badge.

A practical implementation sequence

  1. Choose one customer type, corridor, and commercial use case.
  2. Map entities, funds flow, legal responsibilities, and settlement accounts.
  3. Implement the ledger, canonical payment intent, one rail adapter, and reconciliation.
  4. Add support tooling, refunds, returns or disputes, incident pause controls, and negative tests.
  5. Measure completion, losses, support rate, settlement reliability, and close quality.
  6. Add the next rail only after the first can be operated safely.

The result is a payment platform that can expand without confusing “one API” with “one behavior.”

Related Field Notes

Go from overview to implementation detail.

Long-form guides cover state machines, rail evidence, operational controls, reconciliation, and production failure modes.

Turn the guide into a system boundary.

Map the parties, rail, funds flow, ledger entries, policy decisions, evidence, and exception owners before choosing endpoints.