Mercari Engineering
Read post

Rethinking Payment APIs at Merpay: The Exchange Abstraction

Merpay's Payment Platform team describes a new abstraction called Exchange to unify fragmented payment APIs. Instead of separate APIs for payments, top-ups, transfers, and partner settlements, Exchange models any fund movement as a source-to-destination operation with a two-phase Authorize/Capture lifecycle. The design introduces a Value concept to unify payment methods and destinations, passes accounting codes through the API to eliminate hardcoded accounting logic, and uses a Saga pattern for failure compensation in distributed transactions. Extension points (Hooks, Steps, Decisions) allow product teams to inject use-case-specific logic like KYC checks without polluting the core. The goal is to reduce coordination overhead, clarify API responsibilities, and enable faster onboarding of new payment use cases.

    #architecture#fintech#distributed-systems
Today•15m read time•From engineering.mercari.com
Post cover image
Table of contents
BackgroundProblemsWhat is an Exchange?Design PhilosophyThe Anatomy of an ExchangeThe Value ConceptPractical ExampleFuture ExtensionsConclusion
147 Impressions
Mercari Engineering's image
Mercari Engineering

Mercari's platform is a resource for developers and technology enthusiasts, offering insights into e...

29 Followers

•

368 Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard