Overview
Brazil Receita WS offers a suite of web services managed by the Receita Federal do Brasil (RFB), the Brazilian federal tax authority. These services are designed to provide direct, programmatic access to official tax and registration data, serving as a critical resource for businesses and systems operating within Brazil. The primary function of the Receita WS is to enable automated verification and retrieval of essential fiscal information, ensuring compliance with Brazilian tax laws and regulations. This includes the ability to validate the status and details of corporate entities via their Cadastro Nacional da Pessoa Jurídica (CNPJ) and individuals through their Cadastro de Pessoas Físicas (CPF).
The API is particularly valuable for financial institutions, e-commerce platforms, and any organization requiring real-time verification of customer or vendor data against official government records. By integrating with Brazil Receita WS, developers can build applications that automatically check the validity of tax IDs, retrieve company registration details, and ensure that transactions and registrations adhere to Brazilian fiscal requirements. This reduces the manual effort associated with compliance checks, minimizes errors, and helps prevent fraud by confirming the legitimacy of entities. Its utility extends across various sectors, from onboarding new clients and partners to processing payments and managing legal documentation, where accurate and up-to-date fiscal information is paramount. The services are provided free of charge, aligning with the government's objective to facilitate fiscal transparency and administrative efficiency across the country. Developers can find general information about accessing these services through the official Brazilian government services portal.
The technical architecture typically involves SOAP-based web services, which are standard for many government systems globally, including those maintained by the Brazilian government. While modern APIs often favor RESTful architectures, the established nature of SOAP in legacy government systems ensures robust data exchange and strong typing. Developers integrating with Receita WS must adhere to specific XML schema definitions and security protocols, which often involve digital certificates for authentication and secure communication. Understanding these technical nuances is crucial for successful implementation, as detailed in various W3C specifications for SOAP.
Key features
- CNPJ Validation and Consultation: Allows real-time verification of the Cadastro Nacional da Pessoa Jurídica (CNPJ) status, retrieving official company registration data, including business name, legal nature, address, and activity codes.
- CPF Validation and Consultation: Enables validation of individual tax identification numbers (Cadastro de Pessoas Físicas - CPF) and consultation of associated data, confirming the legal status of individuals.
- Tax Debt Consultation: Provides interfaces to query outstanding tax debts and fiscal liabilities for entities and individuals registered with the Receita Federal.
- Fiscal Regularity Certificate (CRF) Issuance: Facilitates the automated issuance or verification of Certificates of Fiscal Regularity, which attest to an entity's or individual's compliance with federal tax obligations.
- Brazilian Government Services Access: Offers a gateway for various other government-related services and data points, streamlining interactions with federal agencies.
Pricing
As a public service provided by the Brazilian federal government, the Brazil Receita WS is available without direct monetary cost for its core functionalities related to tax data access and compliance checks. Access is typically granted based on official registration and adherence to governmental usage policies.
| Service Tier | Cost (BRL) | Details | As-of Date |
|---|---|---|---|
| Standard Access | Free | Access to core CNPJ, CPF, and fiscal regularity queries for registered users. | 2026-05-28 |
| Premium/High-Volume | Free | No explicit premium tiers with monetary cost; usage limits may apply based on governmental policy. | 2026-05-28 |
For more specific details on access requirements and any potential indirect costs (e.g., for digital certificates required for secure access), refer to the official Receita Federal services page.
Common integrations
- Enterprise Resource Planning (ERP) Systems: Integrating with platforms like Salesforce or SAP to automatically validate customer and vendor tax IDs during onboarding or transaction processing. Salesforce documentation often covers custom API integrations.
- Financial Management Software: Connecting with accounting and financial systems to ensure compliance with Brazilian tax regulations for invoicing, payroll, and reporting.
- E-commerce Platforms: Utilizing Receita WS to verify customer CPF/CNPJ during checkout for tax calculation accuracy and fraud prevention.
- Customer Relationship Management (CRM) Systems: Enriching customer profiles with verified fiscal data from the Receita Federal.
- Fraud Detection and Prevention Systems: Incorporating tax ID validation into fraud algorithms to confirm entity legitimacy and reduce risk.
Alternatives
- Akoya API: While focused on financial data aggregation in the US, Akoya provides a similar function of secure data exchange, albeit in a different regulatory context. Its model of consumer-permissioned data access offers a parallel to trusted data sources, as detailed by Akoya's platform overview.
- Yapily API: An Open Banking platform primarily for European markets, Yapily offers API connectivity to financial data, comparable in its goal of simplifying secure access to regulated information.
- Internal Database Management: Maintaining a proprietary database of known CNPJs/CPFs, though this requires constant manual updates and lacks real-time official verification.
- Third-party Brazilian Data Providers: Commercial services that aggregate and resell Brazilian public data, often adding value-added services but may involve subscription fees.
- Manual Consultation: Directly accessing the Receita Federal website for individual queries, which is suitable for low-volume checks but not for automated, high-volume operations.
Getting started
Integrating with Brazil Receita WS typically involves consuming SOAP web services. The specific WSDL (Web Services Description Language) URLs are provided by the Receita Federal upon registration. The following Python example demonstrates a conceptual interaction using the zeep library to call a hypothetical Receita Federal service for CNPJ validation. Note that actual WSDL URLs, service methods, and authentication (often via digital certificates) would need to be configured based on official documentation.
from zeep import Client
from zeep.wsse.username import UsernameToken
# NOTE: Replace with actual WSDL URL and credentials provided by Receita Federal
WSDL_URL = 'https://some-receita-federal-service.gov.br/cnpjservice?wsdl' # Example URL
USERNAME = 'your_username'
PASSWORD = 'your_password'
try:
# Initialize SOAP client with WS-Security for authentication
# Actual authentication might involve digital certificates (.pfx files) and specific headers
# For simplicity, using UsernameToken here; consult RFB docs for precise method
client = Client(WSDL_URL, wsse=UsernameToken(USERNAME, PASSWORD))
# Example: Calling a hypothetical CNPJ validation service
# Method name and parameters will vary based on the specific service WSDL
cnpj_number = '00000000000100' # Example CNPJ
print(f"Attempting to validate CNPJ: {cnpj_number}")
# Hypothetical service method call
response = client.service.consultarCnpj(cnpj=cnpj_number)
# Process the response
if response and response.status == 'SUCCESS':
print("CNPJ Validation Successful!")
print(f"Company Name: {response.companyName}")
print(f"Status: {response.registrationStatus}")
# ... further processing of response data
else:
print("CNPJ Validation Failed or returned an error.")
print(f"Error Details: {response.errorMessage if response else 'No response'}")
except Exception as e:
print(f"An error occurred during CNPJ consultation: {e}")
This example illustrates the typical pattern: initializing a SOAP client with the service WSDL, providing authentication credentials (often involving a digital certificate and password), and then invoking a specific service method with the required parameters. Developers should consult the official Receita Federal documentation for precise WSDL endpoints, authentication mechanisms, and method signatures, as these can vary for each specific service (e.g., CNPJ consultation, CPF validation, tax debt query).