This paper presents a stress test framework for nonfinancial corporate (NFC) balance sheets. The model simulates firm income statements and balance sheets conditional on macro-financial scenarios, to obtain conventional risk metrics such as probabilities of default (PDs) and loss given default (LGD), alongside other structural metrics such as interest coverage ratios, leverage, and others. The model entails explicit stock–flow accounting and a link of borrowing costs to firm-specific credit risk metrics, i.e., an endogenous cost of funding feedback. An illustration is provided with an application to Brazil, involving 8,000 private firms and three hundred listed nonfinancial firms. The results point to heightened vulnerabilities under stagflation shock scenarios, which jointly weaken earnings and raise funding costs, increasing default risk and debt at risk.