COGS (Cost of Goods Sold)
The direct costs of delivering your product to customers. For SaaS, COGS typically includes hosting, third-party software, customer support, and payment processing fees.
What Is COGS in SaaS?
What to Include in SaaS COGS (and What to Leave Out)
| Cost line | Usually booked as | Why |
|---|---|---|
| Production hosting & infrastructure | COGS | Scales with the customers you serve. |
| Development, staging & test environments | OpEx (R&D) | Used to build the product, not to deliver it. |
| Third-party APIs & software inside the product | COGS | Messaging, data, maps or AI APIs your customers consume. |
| Internal tools (CRM, HR, accounting software) | OpEx (S&M or G&A) | Runs the company, not the service. |
| Customer support team | COGS | Serving existing customers is part of delivery. |
| Customer success | Split: COGS / S&M | Onboarding and retention work is COGS; quota-carrying upsell work is sales. |
| Implementation & onboarding services | COGS (services) | Report against services revenue, not subscription. |
| Payment processing fees | Usually COGS | A per-transaction cost of collecting revenue. |
| DevOps / SRE keeping production running | COGS | Uptime and incident response for live customers. |
| Engineers building new features | OpEx (R&D) | Future product, not current delivery. |
| Sales commissions & marketing | OpEx (S&M) | Acquisition costs, never COGS. |
| Amortization of capitalized software | Often COGS | Many companies book it in cost of revenue — disclose it. |
How to Calculate SaaS COGS
Worked example: a SaaS company with $2,000,000 in annual subscription revenue spends $180,000 on production hosting, $60,000 on third-party APIs, $150,000 on its support team, $50,000 on payment processing and $60,000 on the share of DevOps time spent on production. COGS is $500,000 — 25% of revenue — which gives a gross margin of 75%.
Exclude sales, marketing, R&D, and general administrative costs — those are operating expenses (OpEx), not COGS. The distinction matters because gross margin (Revenue - COGS) is the first profitability metric investors examine.