Hybrid operation under a single tax ID#
The operational scenario that motivated this fiscal audit is as follows: a single Brazilian MEI CNPJ (Microempreendedor Individual tax registration) being used to operate simultaneously:
- SaaS with recurring billing - B2B platform with monthly subscription
- Internal marketplace - commission on third-party course sales
- Banner advertising and affiliate program - revenue from brokerage
- Prepared food delivery - iFood and proprietary channel
- Physical product sales - notebooks, crocheted goods, crafts, IT supplies
Original registered CNAEs: Independent computer maintenance technician + Prepared food supplier for companies. Upon attempting to integrate Stripe as the payment gateway for the SaaS, the risk of account blockage due to CNAE inconsistency became concrete and immediate.
Stripe's verification logic (and every serious gateway)#
International payment gateways (Stripe, PayPal Braintree, Adyen) perform a KYB (Know Your Business) process during onboarding and continuously monitor consistency between:
- What the website/app sells (detected via landing page scraping, terms of service, and pricing page)
- The business description provided during registration
- The CNAE/activity code registered on the company's CNPJ/EIN/VAT
If a B2B subscription software is being sold and the CNPJ says Independent computer maintenance technician, the compliance system classifies this as a business category inconsistency, one of the main triggers for account blockage, balance freezing, and requests for additional documentation.
The blockage is not subjective: Stripe uses machine behavior models trained on MCC (Merchant Category Code) categories mapped to business types. A subscription-based SaaS falls under MCC 5734 (Computer Software Stores) or 7372 (Computer Programming, Data Processing). If the CNAE does not support these categories, the risk of account blockage is high.
The regulatory obstacle: software development is prohibited under MEI#
Here is the silent trap that affects every developer under MEI:
Software Development (CNAE 6201-5/00, 6202-3/00) and Software Licensing (6209-1/00) are expressly prohibited activities for MEI registration.
The single annex of CGSN Resolution 148/2019 and subsequent updates on the Empreendedor Portal and the Federal Revenue Service list permitted MEI activities. Software development and licensing are not on this list. Any attempt to add these CNAEs results in an error on the Empreendedor Portal.
The practical implication: If you sell a SaaS under MEI declaring "software development," you are:
- Engaging in a prohibited activity → risk of MEI disqualification by the Federal Revenue Service
- In inconsistency with the payment gateway → risk of Stripe account blockage
The solution is not to force the prohibited CNAE. The solution is to frame the business by the service delivered to the client, not the technical asset that sustains it.
The SaaS framing strategy as an instruction service#
The turning point of the analysis was understanding that the SaaS customer is not buying "software": they are paying for access to a structured methodology, organized data, and training in platform usage. This is, in the language of the Federal Revenue Service, an instruction service.
The first attempt trap: Preparatory course instructor#
An initial search on the Empreendedor Portal for "instructor" returns "Preparatory course instructor." This would be a serious misclassification because:
- A B2B SaaS has no relation to preparatory courses (university entrance exams, public service exams)
- A tax auditor or the gateway's compliance analyst may question the inconsistency
- The associated CNAE does not support recurring software revenue
The correct solution: IT instructor, independent#
This occupation on the Empreendedor Portal maps to CNAE 8599-6/04 - Computer training. The justification is technically defensible:
The client contracts access to the platform and the value delivered is learning and using the system's proprietary methodology. The software is the vehicle; the instruction is the product.
This is the occupation that Stripe and other gateways recognize as consistent with the sale of access to digital knowledge platforms.
Complementary CNAE for the SaaS database: Data list editor#
To cover the structured data dimension that the platform provides (reports, dashboards, data exports), the occupation Data list and other information editor, independent adds a layer of compliance. Its associated CNAE is 6312-2/00 - Portals, content providers and other internet information services, which perfectly covers data delivery via web.
Marketplace engineering: commissions, affiliates, and banners#
The marketplace operation introduces an additional layer of complexity. When a third-party user sells a R$100 course on the platform and the operator retains R$20 in commission, the following occurs:
Fiscal problem without Split Payment:
- The R$100 enters the operator's account
- The operator transfers R$80 to the partner
- The gross revenue computed by the Federal Revenue Service is R$100
- In a MEI with a R$81,000/year ceiling, this exhausts capacity 5x faster than actual revenue
Solution: Split Payment configured in Stripe
Stripe allows configuring Stripe Connect with the "Destination Charges" or "Separate Charges and Transfers" model:
Customer pays R$100
↓
Stripe processes
↓
┌─────────────────────────┐
│ Split at the source: │
│ R$80 → Partner │
│ R$20 → Operator │
└─────────────────────────┘
↓
Operator issues invoice only
on the R$20 (commission)
as "Independent Sales Promoter"
The invoice issued by the operator covers the commission, not the gross sale value. This is perfectly supported by the Independent sales promoter CNAE, which fiscally justifies retaining a percentage of brokered transactions.
For banners and advertising displayed on the platform, the same Sales promoter classification covers advertising brokerage revenue.
Technical integration and programmatic validation#
In addition to configuring proper CNAEs on your CNPJ, you must write backend sanity checks to monitor payment processor status. If a KYC validation or KYB check goes out of alignment, Stripe will block charges/payouts and emit warnings. Your DevOps team can automate alerts by hooking into these states programmatically.
1. Retrieving account KYC status via stripe API#
Use the Stripe SDK to programmatically read account capabilities and capture pending validation details:
const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);
async function checkAccountCompliance(accountId) {
try {
const account = await stripe.accounts.retrieve(accountId);
console.log(`Stripe KYB Audit for Account: ${accountId}`);
console.log(`Charges Enabled: ${account.charges_enabled}`);
console.log(`Payouts Enabled: ${account.payouts_enabled}`);
if (account.requirements && account.requirements.currently_due.length > 0) {
console.warn('WARNING: Pending compliance requirements (KYB):');
console.warn(account.requirements.currently_due);
}
return {
active: account.charges_enabled && account.payouts_enabled,
pendingRequirements: account.requirements ? account.requirements.currently_due : []
};
} catch (error) {
console.error('Failed to query Stripe compliance status:', error);
throw error;
}
}
2. Active webhook event handling (express.js)#
Register Stripe webhooks to dynamically listen to account updates (account.updated). This enables DevOps monitoring for tax and compliance issues:
const express = require('express');
const app = express();
const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);
// Secure webhook endpoint
app.post('/stripe-webhooks', express.raw({ type: 'application/json' }), (req, res) => {
const sig = req.headers['stripe-signature'];
const endpointSecret = process.env.STRIPE_WEBHOOK_SECRET;
let event;
try {
event = stripe.webhooks.constructEvent(req.body, sig, endpointSecret);
} catch (err) {
console.error(`Webhook signature verification failed: ${err.message}`);
return res.status(400).send(`Webhook Error: ${err.message}`);
}
// Monitor compliance change events
if (event.type === 'account.updated') {
const account = event.data.object;
if (!account.charges_enabled) {
// Trigger DevOps alarm: Send email alert or notification to Slack
triggerDevOpsAlert(`STRIPE ACCOUNT BLOCKED! KYC issues or compliance mismatch on ID: ${account.id}`);
}
if (account.requirements && account.requirements.currently_due.length > 0) {
logComplianceWarning(account.id, account.requirements.currently_due);
}
}
res.json({ received: true });
});
function triggerDevOpsAlert(message) {
console.error(`[SECURITY ALERT]: ${message}`);
// Connect to PagerDuty, Slack, or Microsoft Teams API
}
function logComplianceWarning(accountId, requirements) {
console.warn(`[KYC WARNING] Account ${accountId} has pending requirements:`, requirements);
}
The physical products CNAE stack#
Mixing physical products and digital services under MEI requires commerce CNAEs, because issuing an invoice for a physical product under a service CNAE generates seizure at the post office and carrier fines.
The practical difficulty: the Empreendedor Portal uses "occupation names" that do not directly correspond to commercial product descriptions. The search requires knowing specific terms:
| Product to sell | Search term in Portal | Resulting CNAE |
|---|---|---|
| Crocheted goods, crafts, souvenirs | Souvenirs (Suvenires) | 4789-0/99 |
| Notebooks, pens, stationery | Office equipment | 4789-0/04 |
| Cables, mice, keyboards, drives | IT supplies | 4751-2/01 |
| Appliances, TVs, audio | Household appliances and audio/video equipment | 4753-9/00 |
| Phones, routers, accessories | Telephony and communication equipment | 4752-1/00 |
| Pet food, treats, accessories | Pet articles and food (pet shop) | 4789-0/07 |
The final stack: complete configuration in the empreendedor portal#
After the complete audit of all revenue streams, this is the definitive configuration registered:
Primary Occupation:
IT instructor, independent
→ CNAE: 8599-6/04 - Covers the SaaS and recurring subscriptions
Secondary Occupations:
1. Data list and other information editor, independent
→ CNAE: 6312-2/00 - Data, reports, SaaS exports
2. Sales promoter, independent
→ CNAE: 7490-1/04 - Marketplace, affiliates, banners, commissions
3. Prepared food supplier for companies, independent
→ CNAE: 5620-1/02 - iFood delivery and B2B food clients
4. Independent trader of souvenirs, costume jewelry, and crafts
→ CNAE: 4789-0/99 - Crocheted goods, crafts, souvenirs
5. Independent trader of office equipment
→ CNAE: 4789-0/04 - Stationery, notebooks, pens, school supplies
6. Independent trader of IT equipment and supplies
→ CNAE: 4751-2/01 - Peripherals, cables, accessories
7. Independent trader of household appliances and audio/video equipment
→ CNAE: 4753-9/00 - TVs, speakers, home appliances
8. Independent trader of telephony and communication equipment
→ CNAE: 4752-1/00 - Cell phones, routers, telco accessories
9. Independent pet articles and food trader (pet shop)
→ CNAE: 4789-0/07 - Pet products
Technical compliance checklist (stripe + MEI)#
1. Legal and business setup#
- [ ] CNPJ MEI setup matching details on official Federal Revenue records.
- [ ] Registered training and data list editor CNAEs to cover SaaS transactions.
- [ ] Registered sales promoter CNAEs to cover marketplace brokerages.
- [ ] Public terms of service page clarifying that users pay for methodology training/data access.
2. Programmatic integration#
- [ ] Create API checks to verify
charges_enabledandpayouts_enabledstatus. - [ ] Configure Stripe webhooks listener to handle
account.updatedevents. - [ ] Design graceful transaction degradation flows if payment compliance is flagged.
3. Monitoring & alerts#
- [ ] Connect Slack or email alerts to trigger if account compliance changes.
- [ ] Perform periodic audits of gross income against MEI ceiling limits (R$ 81,000/year).
Compliance risk matrix (troubleshooting)#
| Risk Item | Severity | Technical Description | Mitigation / Corrective Action |
|---|---|---|---|
| CNAE Mismatch (KYB) | High | Stripe detects conflicts between page terms (software) and tax classifications (maintenance). | Adjust CNPJ record to use "IT Instructor" occupation mapping to CNAE 8599-6/04. |
| No Split Payment Setup | High | Receiving gross amounts and manually wire-transferring parts consumes the R$ 81,000 MEI ceiling immediately. | Build Stripe Connect (Destination Charges) to split payments dynamically on raw transactions. |
| MEI Disqualification | High | Federal Revenue flags forbidden service offerings (e.g. software development CNAEs). | Keep only permitted classifications, and migrate to ME (Simples Nacional) if limits are exceeded. |
| Physical Shipments Seizure | Medium | Shipping physical parcels using service-based invoices results in customs blockages. | Add specific commerce CNAEs on the tax ID and generate proper NF-e invoices for every shipment. |
Limits and the MEI exit route#
This configuration is tactical and temporary. The MEI structural limits that must be monitored:
| Limit | Value | Migration Trigger |
|---|---|---|
| General annual revenue | R$81,000 | Migrate to ME/Simples Nacional |
| Annual service revenue | R$72,000 | Service segment has a lower ceiling |
| CLT employee | Maximum 1 | Upon hiring a 2nd collaborator |
| Business partner | Prohibited | Upon receiving equity investment |
When the SaaS or marketplace scales above R$6,750/month (R$81k ÷ 12), migration to Microenterprise (ME) under Simples Nacional becomes mandatory. Under ME, CNAE 6201-5/00 (Software Development) becomes available - and then the business description for Stripe is finally 100% aligned without needing an indirect framing strategy.
What about international expansion? Compliant cross-border hiring#
As a software platform scales, another common operational hurdle I observe among founders is building an engineering and support team. Sourcing remote contractors and engineers across borders introduces legal liabilities regarding contractor misclassification and complex tax compliance requirements (such as IRS W-8BEN/W-9 forms or local statutory withholdings).
Relying on informal agreements or generic wire transfers is an operational vulnerability that complicates future funding rounds and payment audits. To hire globally without incorporating legal subsidiaries in each target country, the benchmark platform I recommend and rely on is Deel. It operates as an Employer of Record (EOR) and global payroll management platform across 150+ countries, automating legally sound, localized agreements and multi-currency payouts with full compliance.
Operational outcome#
- ✅ Stripe approved without caveats (instruction CNAE compatible with digital platform MCC)
- ✅ Physical shipments via postal service without seizure (correct commerce CNAEs for each product)
- ✅ Delivery operating legally (food supply CNAE maintained)
- ✅ Stripe Split Payment configured: invoice on commission, not gross value
- ✅ MEI without disqualification risk (zero prohibited CNAEs)
Was this article helpful?
Leave a quick reaction to help prioritize future technical guides:
This post is licensed under CC BY-NC.



Comments
Join the discussion below.
0 comments