{"id":377752,"date":"2026-10-12T15:45:18","date_gmt":"2026-10-12T15:45:18","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/checkout-brasil-cpf-cnpj-cep-e-campos-brasileiros\/"},"modified":"2026-10-14T20:28:15","modified_gmt":"2026-10-14T20:28:15","slug":"rebel-studios-brazilian-checkout-fields","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/rebel-studios-brazilian-checkout-fields\/","author":23563171,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0.5","stable_tag":"1.0.5","tested":"7.1.3","requires":"6.5","requires_php":"7.4","requires_plugins":null,"header_name":"Rebel Studios Brazilian Checkout Fields for WooCommerce","header_author":"Rebel Studios Software","header_description":"Campos brasileiros no checkout do WooCommerce: CPF, CNPJ, Raz\u00e3o Social, RG, IE, n\u00famero e bairro. Valida\u00e7\u00e3o real, preenchimento autom\u00e1tico por CEP e CNPJ, e os dados no pedido, nos e-mails e na nota fiscal. Cada campo pode ser desativado.","assets_banners_color":"","last_updated":"2026-10-14 20:28:15","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/rebelstudiossoftware.com\/checkout-brasil.html","header_author_uri":"https:\/\/rebelstudiossoftware.com\/","rating":0,"author_block_rating":0,"active_installs":0,"downloads":76,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.5":{"tag":"1.0.5","author":"rebelstudios","date":"2026-10-14 20:28:15","revision":3747098}},"upgrade_notice":{"1.0.5":"<p>Stops the classic checkout from losing letters typed right after the CEP on some plain-permalink stores, and labels a CNPJ required for companies as required.<\/p>","1.0.4":"<p>Fixes a wrong house number on some shipping addresses (classic checkout), missing document fields on the block checkout of WooCommerce 8.9 to 9.8, and an unenforced required CNPJ; adds personal-data export and erasure.<\/p>","1.0.3":"<p>Renamed plugin and internal code prefix ahead of the WordPress.org listing; no change to features.<\/p>","1.0.1":"<p>Fixes CNPJ input and autofill on the block checkout, and adds individual\/company choice and shipping number\/neighbourhood there.<\/p>","1.0.0":"<p>Initial release.<\/p>"},"ratings":[],"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.5"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3742035,"resolution":"1","location":"assets","locale":"","width":1280,"height":1152},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3742035,"resolution":"2","location":"assets","locale":"","width":1280,"height":1019},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3742035,"resolution":"3","location":"assets","locale":"","width":1120,"height":828}},"screenshots":{"1":"Checkout fields with input masks, CPF validation and the address filled in from the CEP.","2":"Settings: each field can be disabled, optional or required.","3":"Diagnostics panel \u2014 versions, checkout type, HPOS, and whether the lookups are responding."}},"plugin_section":[],"plugin_tags":[8286,8287,157502,152487,66145],"plugin_category":[45],"plugin_contributors":[283274],"plugin_business_model":[],"class_list":["post-377752","plugin","type-plugin","status-publish","hentry","plugin_tags-brasil","plugin_tags-brazil","plugin_tags-cep","plugin_tags-cnpj","plugin_tags-cpf","plugin_category-ecommerce","plugin_contributors-rebelstudios","plugin_committers-rebelstudios"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/rebel-studios-brazilian-checkout-fields.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/rebel-studios-brazilian-checkout-fields\/assets\/screenshot-1.png?rev=3742035","caption":"Checkout fields with input masks, CPF validation and the address filled in from the CEP."},{"src":"https:\/\/ps.w.org\/rebel-studios-brazilian-checkout-fields\/assets\/screenshot-2.png?rev=3742035","caption":"Settings: each field can be disabled, optional or required."},{"src":"https:\/\/ps.w.org\/rebel-studios-brazilian-checkout-fields\/assets\/screenshot-3.png?rev=3742035","caption":"Diagnostics panel \u2014 versions, checkout type, HPOS, and whether the lookups are responding."}],"raw_content":"<!--section=description-->\n<p><strong>Rebel Studios Brazilian Checkout Fields<\/strong> adds the fields a Brazilian store needs to the WooCommerce checkout \u2014 CPF, CNPJ, company legal name (Raz\u00e3o Social), RG, state registration (Inscri\u00e7\u00e3o Estadual), street number and neighbourhood (bairro) \u2014 and does three things that are usually missing:<\/p>\n\n<ol>\n<li><strong>Real validation.<\/strong> CPF and CNPJ are checked against the official check digits, in the browser <em>and<\/em> on the server. An invalid document never reaches the order.<\/li>\n<li><strong>Autofill.<\/strong> Type the CEP and the street, neighbourhood, city and state fill in. Type the CNPJ and the company's legal name and address come with it.<\/li>\n<li><strong>The data goes where you need it.<\/strong> CPF, CNPJ and legal name appear on the order screen, in emails and in the REST API \u2014 ready for your invoicing (NF-e) integration. Collecting a document you cannot use later is the problem this plugin exists to solve.<\/li>\n<\/ol>\n\n<p>The plugin's interface is in Brazilian Portuguese. It is fully internationalized (i18n), so it can be translated into any language through translate.wordpress.org once published.<\/p>\n\n<h4>Every field is optional<\/h4>\n\n<p>Each field has three states: <strong>Disabled<\/strong>, <strong>Optional<\/strong> or <strong>Required<\/strong>. A store that sells digital products does not need to ask for a CPF; one that invoices companies needs a CNPJ and legal name and nothing else. You decide, without touching code.<\/p>\n\n<h4>Works with both checkouts<\/h4>\n\n<p>Compatible with the WooCommerce <strong>classic checkout<\/strong> and the <strong>block checkout<\/strong>, and with <strong>HPOS<\/strong> (High-Performance Order Storage). Data is stored the same way by both checkouts, so an invoicing integration only has to read one format.<\/p>\n\n<p>On the block checkout, customers choose between individual (Pessoa F\u00edsica) and company (Pessoa Jur\u00eddica), and see only the documents for that choice.<\/p>\n\n<h4>Privacy and reliability<\/h4>\n\n<p>CEP and CNPJ lookups are made <strong>from your server<\/strong>, not from the customer's browser, and are cached. If a lookup service is down, the customer simply types the address \u2014 <strong>a purchase is never blocked<\/strong> by a third-party API.<\/p>\n\n<h3>External services<\/h3>\n\n<p>To fill an address from a postcode and a company from its registration number, this plugin sends the value the customer typed to two free, public Brazilian services. Every request is made <strong>from your server<\/strong> (never the customer's browser), <strong>only<\/strong> when a customer enters a CEP or a CNPJ, and the response is cached on your site so the same value is not looked up twice. No data is ever sent to the makers of this plugin.<\/p>\n\n<p><strong>ViaCEP<\/strong> (https:\/\/viacep.com.br\/)\nUsed to turn a Brazilian postcode into a street address. When a customer types an 8-digit CEP, that CEP \u2014 and nothing else \u2014 is sent to ViaCEP, which returns the street, neighbourhood, city and state. No personal data (name, email, document number) is sent. ViaCEP is a free public service that does not publish a separate terms-of-service or privacy-policy page; its usage information is on its website: https:\/\/viacep.com.br\/.<\/p>\n\n<p><strong>BrasilAPI<\/strong> (https:\/\/brasilapi.com.br\/)\nUsed to turn a company registration number into the company's public details. When a customer types a 14-digit CNPJ (a public company registration number, not personal data), that CNPJ \u2014 and nothing else \u2014 is sent to BrasilAPI, which returns the company's public registration data (legal name and registered address). BrasilAPI is a free, open-source community project. Its terms of use are published on its site: https:\/\/brasilapi.com.br\/#termos-de-uso . It does not publish a separate privacy-policy page; the project and its source are documented at https:\/\/brasilapi.com.br\/ .<\/p>\n\n<p>The Diagnostics panel on the settings screen also sends one sample request to each service (at most once every 5 minutes) to show whether it is responding. It uses a fixed example CEP and CNPJ, never customer data.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Install and activate the plugin.<\/li>\n<li>Go to <strong>WooCommerce \u2192 Checkout Brasil<\/strong>.<\/li>\n<li>For each field, choose Disabled, Optional or Required.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"the%20fields%20do%20not%20appear%20on%20my%20checkout.\"><h3>The fields do not appear on my checkout.<\/h3><\/dt>\n<dd><p>It is almost always the checkout type. If your store uses the <strong>block checkout<\/strong> and your previous plugin only supported the classic checkout, no fields appear \u2014 which is exactly why this plugin exists.<\/p>\n\n<p>Go to <strong>WooCommerce \u2192 Checkout Brasil<\/strong> and look at the <strong>Diagnostics<\/strong> panel at the bottom of the page. It tells you which checkout your store uses, whether the fields are active, and whether another plugin is competing for the same fields. Copy that report before opening a support request.<\/p><\/dd>\n<dt id=\"can%20i%20turn%20off%20the%20cpf%3F\"><h3>Can I turn off the CPF?<\/h3><\/dt>\n<dd><p>Yes. Every field has three states \u2014 Disabled, Optional, Required \u2014 under <strong>WooCommerce \u2192 Checkout Brasil<\/strong>. Nothing is forced, including the CPF.<\/p><\/dd>\n<dt id=\"the%20fields%20appear%20twice.\"><h3>The fields appear twice.<\/h3><\/dt>\n<dd><p>You have two checkout-field plugins active at the same time. The Diagnostics panel detects the common ones (Brazilian Market on WooCommerce, Checkout Field Editor, Flexible Checkout Fields). Deactivate one of them.<\/p><\/dd>\n<dt id=\"i%20am%20migrating%20from%20%22brazilian%20market%20on%20woocommerce%22.%20is%20my%20old%20data%20lost%3F\"><h3>I am migrating from \"Brazilian Market on WooCommerce\". Is my old data lost?<\/h3><\/dt>\n<dd><p>Old orders stay intact \u2014 this plugin deletes nothing. It stores data in its own meta keys (<code>_billing_rsbcf_cpf<\/code>), different from the old plugin's (<code>_billing_cpf<\/code>), precisely to avoid conflicts. New orders use the new keys; old orders remain readable by the old plugin while it is installed.<\/p><\/dd>\n<dt id=\"cep%20lookup%20stopped%20working.%20can%20my%20customers%20still%20buy%3F\"><h3>CEP lookup stopped working. Can my customers still buy?<\/h3><\/dt>\n<dd><p>Yes. A failed lookup is ignored and the customer types the address normally. <strong>A purchase is never blocked<\/strong> by a third-party API. The Diagnostics panel shows whether ViaCEP and BrasilAPI are responding right now.<\/p><\/dd>\n<dt id=\"do%20cpf%2Fcnpj%20show%20up%20on%20the%20invoice%3F\"><h3>Do CPF\/CNPJ show up on the invoice?<\/h3><\/dt>\n<dd><p>They are stored on the order (<code>_billing_rsbcf_cpf<\/code>, <code>_billing_rsbcf_cnpj<\/code>, <code>_billing_rsbcf_company_legal_name<\/code>) and shown on the order screen, in emails and in the REST API \u2014 which is where NF-e integrations read them. If your integration expects different field names, the <code>rsbcf_order_values<\/code> filter lets you remap them.<\/p><\/dd>\n<dt id=\"does%20it%20work%20with%20hpos%3F\"><h3>Does it work with HPOS?<\/h3><\/dt>\n<dd><p>Yes, compatibility is declared. Data is saved through the WooCommerce order API, so it works the same with HPOS on or off.<\/p><\/dd>\n<dt id=\"does%20it%20work%20with%20pagseguro%20%2F%20mercado%20pago%20%2F%20pagbank%3F\"><h3>Does it work with PagSeguro \/ Mercado Pago \/ PagBank?<\/h3><\/dt>\n<dd><p>The fields use their own names (<code>billing_rsbcf_*<\/code>) instead of the generic names several plugins fight over, which is the most common cause of gateway conflicts. If you still hit a conflict, send the Diagnostics report and we can answer on the first reply.<\/p><\/dd>\n<dt id=\"is%20the%20cpf%20really%20validated%3F\"><h3>Is the CPF really validated?<\/h3><\/dt>\n<dd><p>Yes, with the official check digits, in the browser and <strong>again on the server<\/strong>. An invalid document never reaches the order. Repeated sequences (111.111.111-11) are rejected.<\/p><\/dd>\n<dt id=\"do%20you%20receive%20my%20customers%27%20data%3F\"><h3>Do you receive my customers' data?<\/h3><\/dt>\n<dd><p>No. Lookups go from your server straight to ViaCEP and BrasilAPI, and responses are cached on your site. There is no server of ours in between.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.5<\/h4>\n\n<ul>\n<li>Fix: on the classic checkout, letters typed just after changing the CEP could be lost, and the order stored \"C\u00e7\u00e3o\" for \"Consola\u00e7\u00e3o\". WooCommerce takes the focus away from every field when the order review update comes back with a notice; on some stores with plain permalinks a leftover \"added to your cart\" notice comes back on every update. The field being typed in now keeps the focus. This also happens without this plugin, in WooCommerce's own fields, and they are protected too.<\/li>\n<li>Fix: with the individual\/company choice on, a CNPJ set to required was labelled \"(optional)\" on the classic checkout, although a company could not check out without it. It now carries the required mark. On WooCommerce 8.9 to 9.8 the block checkout labels it \"CNPJ (obrigat\u00f3rio para PJ)\" (CPF: \"obrigat\u00f3rio para PF\").<\/li>\n<\/ul>\n\n<h4>1.0.4<\/h4>\n\n<ul>\n<li>Fix: on the classic checkout, a returning customer who shipped to the billing address got the street number and neighbourhood of their previous shipping address on the order's shipping address, so the label pointed at the wrong house.<\/li>\n<li>Fix: on WooCommerce 8.9 to 9.8, the block checkout with the individual\/company choice showed no CPF, CNPJ or legal name field at all, and with a document set to required it refused every buyer. Those versions now show both documents and check the required one, for the chosen type, when the order is placed. WooCommerce 9.9 and later are unchanged.<\/li>\n<li>Fix: on the classic checkout, a store that collects only company documents (CPF switched off, so no individual\/company choice) did not enforce a required CNPJ and accepted a CNPJ with wrong check digits. Both are now refused, and the field is marked required.<\/li>\n<li>New: WordPress's \"Export Personal Data\" now includes the CPF, CNPJ, RG and the other fields this plugin stores, and \"Erase Personal Data\" removes them from the customer's profile and, when WooCommerce is set to remove order data on request, from their orders.<\/li>\n<li>Fix: searching WooCommerce &gt; Orders for a CPF or CNPJ (digits only) finds the order on stores using High-Performance Order Storage, WooCommerce's default. It only worked on the older posts storage.<\/li>\n<li>Fix: on the classic checkout, a value posted for a field the store has switched off is no longer saved on the order.<\/li>\n<li>Fix: a Shop Manager can save the settings screen. WordPress refused the save to anyone without the administrator's capability.<\/li>\n<li>Fix: an empty required N\u00famero or Bairro shows one error on the classic checkout, not two.<\/li>\n<li>Fix: the Diagnostics panel now recognises Checkout Field Editor (it looked for the wrong file name) and this plugin's own earlier build, sold as \"Checkout Brasil\", which doubles every field when both are active.<\/li>\n<li>Change: a field being looked up (CEP or CNPJ) stays dimmed until the answer arrives, rather than for a fixed 0.9 seconds. The spinner it was meant to show could never appear on an input.<\/li>\n<\/ul>\n\n<h4>1.0.3<\/h4>\n\n<ul>\n<li>Renamed to \"Rebel Studios Brazilian Checkout Fields for WooCommerce\" and moved to a unique, plugin-specific code prefix ahead of the WordPress.org listing. No change to features.<\/li>\n<li>Documented the external services (ViaCEP, BrasilAPI) fully in the readme.<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Fix: CEP autofill now sets the state. It filled street, neighbourhood and city but left the state WooCommerce preselects (the store's own), so a Rio CEP on a S\u00e3o Paulo store kept \"S\u00e3o Paulo\".<\/li>\n<li>Fix: CNPJ autofill fills the registered address only as a whole, and only while the customer hasn't started typing one, so it can no longer mix the company's street into the customer's CEP and state.<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Fix: on the block checkout, a CNPJ typed digit by digit was scrambled by the input mask.<\/li>\n<li>Fix: CEP and CNPJ autofill now works on the block checkout (it only worked on the classic checkout).<\/li>\n<li>New on the block checkout: choose individual or company, with CPF, or CNPJ and legal name, to match.<\/li>\n<li>New on the block checkout: street number and neighbourhood on the shipping address too, not only billing.<\/li>\n<li>Fix: a CPF typed and then hidden by switching to company is no longer saved on the order (both checkouts).<\/li>\n<li>Fix: documents were shown twice on the confirmation page and in emails for block checkout orders.<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial release: CPF, CNPJ, legal name, RG, state registration, street number, neighbourhood and mobile phone.<\/li>\n<li>Check-digit validation in the browser and on the server.<\/li>\n<li>Address lookup by CEP (ViaCEP) and company lookup by CNPJ (BrasilAPI), server-side and cached.<\/li>\n<li>Supports the classic checkout, the block checkout and HPOS.<\/li>\n<li>Data on the order, the order screen, emails and the REST API.<\/li>\n<\/ul>","raw_excerpt":"CPF, CNPJ and CEP fields for WooCommerce in Brazil: check-digit validation, address and company autofill, and the data on orders, emails and the API.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/377752","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=377752"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/rebelstudios"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=377752"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=377752"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=377752"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=377752"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=377752"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=377752"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}