RFC lookup API that returns taxpayer name and fiscal details from just the RFC number?

elena_accounting opened this thread · · 1 reply

rfc-lookuptaxpayer-datainvoicingsat

Question

E
elena_accounting Asker

We're building a cloud accounting platform for small Mexican businesses. One of the most common user pain points during invoice creation is manually entering the recipient's fiscal data — they have to type the RFC, then separately look up and enter the taxpayer name, regime, and postal code. We want to automate this with an RFC lookup API that retrieves all necessary fiscal details from just the RFC number.

The user experience we're designing: user types or pastes the recipient's RFC in the invoice form, our system calls the RFC lookup API in the background, and auto-fills the remaining fields (razón social, régimen fiscal, código postal del domicilio fiscal). This saves time and eliminates data entry errors that cause CFDI stamp rejections.

Technical requirements for the RFC lookup API:

  • Input: 12 or 13 character RFC string
  • Output: taxpayer legal name, tax regime (código de régimen fiscal), fiscal postal code, entity type (persona física/moral), and active/inactive status
  • Response time: under 1 second for a good UX (we'll show a spinner while loading)
  • Error responses for: invalid format, RFC not found, RFC cancelled/blacklisted
  • Rate limit: at least 50 requests per minute (we have concurrent users creating invoices)

We're currently serving about 2,000 small businesses, each creating 50-200 invoices per month. Not every invoice needs a fresh RFC lookup (we cache customer data), but we estimate about 15,000-20,000 unique RFC lookup API calls per month initially. This should grow to 50,000+ as we onboard more clients.

Important compliance note: since CFDI 4.0, the recipient's regime and postal code must exactly match what's registered in SAT. If we auto-fill with data from an RFC lookup API, we need confidence that the data is current. How fresh is the data from third-party providers? If someone changed their fiscal address last week, will the API reflect that?

We're on Next.js with a Vercel deployment. Any RFC lookup API with a JavaScript/TypeScript SDK would be ideal but not required — we can call REST endpoints from API routes. Looking for providers that don't require enterprise contracts — self-service signup with pay-as-you-go pricing preferred.

Answers

P
pedro_saas

We've been doing exactly this in our accounting SaaS for over a year. Found our RFC lookup API provider on apipull.com API Hub and it's been great for the auto-fill workflow. Here's what we learned:

Data freshness: Our provider syncs with SAT every 6 hours for the main taxpayer registry. In practice, address/regime changes take 12-24 hours to propagate. For 99% of invoices this is fine. For the rare cases where it's wrong, users can manually override the auto-filled data.

Caching strategy: We cache RFC lookup results for 7 days on our side. If a CFDI gets rejected due to mismatched data, we purge that RFC from our cache and do a fresh lookup. This happens less than 0.1% of the time.

Performance: Average response time is 280ms — feels instant to users. The API handles burst traffic well since our users tend to create invoices in batches at end of month.

Pricing was self-service, pay per query, no minimum. Started around $0.015 per call with a free tier of 100 queries/month for development. At your volume, you'd probably hit a tier discount.

● Thread open · 1 reply

Find API Providers on apipull.com