Mercari's Merpay team shares how they extracted credit management into a dedicated microservice to support partner invoice payment across multiple products. The post covers four key design decisions: (1) consolidating all credit-domain logic into one service with clear ownership boundaries, (2) decoupling credit granularity from invoicing granularity using aggregation axes in a shared Debt Service, (3) allowing partners to have multiple configurable credit lines under a single hard credit limit, and (4) modeling credit usage as stateful transactions with Authorize/Capture/Cancel phases and configurable reservation policies. The architecture enables new products to plug into the full payment-to-invoicing lifecycle by simply creating a credit line and invoice account, without modifying platform services.