{"id":376677,"date":"2026-09-28T15:27:08","date_gmt":"2026-09-28T15:27:08","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/postali-codigos-postales-de-mexico\/"},"modified":"2026-09-28T15:21:35","modified_gmt":"2026-09-28T15:21:35","slug":"postali-codigos-postales","status":"publish","type":"plugin","link":"https:\/\/nl-be.wordpress.org\/plugins\/postali-codigos-postales\/","author":23575087,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0.0","stable_tag":"1.0.0","tested":"7.1.2","requires":"6.5","requires_php":"7.4","requires_plugins":null,"header_name":"Postali \u2014 C\u00f3digos postales de M\u00e9xico","header_author":"Postali","header_description":"Autocompleta estado, municipio y colonia en el checkout de WooCommerce a partir del c\u00f3digo postal mexicano, usando la API p\u00fablica y gratuita de Postali (datos de SEPOMEX).","assets_banners_color":"f9f6ef","last_updated":"2026-09-28 15:21:35","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/postali.app\/api","header_author_uri":"https:\/\/postali.app","rating":0,"author_block_rating":0,"active_installs":0,"downloads":49,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"gomflo","date":"2026-09-28 15:21:35","revision":3717472}},"upgrade_notice":{"1.0.0":"<p>First release.<\/p>"},"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3717472,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3717472,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3717472,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3717472,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3717472,"resolution":"1","location":"assets","locale":"","width":1220,"height":700},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3717472,"resolution":"2","location":"assets","locale":"","width":524,"height":1169},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3717472,"resolution":"3","location":"assets","locale":"","width":1095,"height":888}},"screenshots":{"1":"Block checkout: typing the postal code fills the state and city, and the colonia becomes a dropdown with every colonia for that postal code.","2":"Classic checkout: a postal code with a single colonia selects it automatically. The postal code field is shown before the street for Mexico.","3":"Settings under WooCommerce &gt; Settings &gt; Postali."}},"plugin_section":[],"plugin_tags":[17237,3148,126659,201910,286],"plugin_category":[45],"plugin_contributors":[283213],"plugin_business_model":[],"class_list":["post-376677","plugin","type-plugin","status-publish","hentry","plugin_tags-address-autocomplete","plugin_tags-checkout","plugin_tags-mexico","plugin_tags-postal-code","plugin_tags-woocommerce","plugin_category-ecommerce","plugin_contributors-gomflo","plugin_committers-gomflo"],"banners":{"banner":"https:\/\/ps.w.org\/postali-codigos-postales\/assets\/banner-772x250.png?rev=3717472","banner_2x":"https:\/\/ps.w.org\/postali-codigos-postales\/assets\/banner-1544x500.png?rev=3717472","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/postali-codigos-postales\/assets\/icon-128x128.png?rev=3717472","icon_2x":"https:\/\/ps.w.org\/postali-codigos-postales\/assets\/icon-256x256.png?rev=3717472","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/postali-codigos-postales\/assets\/screenshot-1.png?rev=3717472","caption":"Block checkout: typing the postal code fills the state and city, and the colonia becomes a dropdown with every colonia for that postal code."},{"src":"https:\/\/ps.w.org\/postali-codigos-postales\/assets\/screenshot-2.png?rev=3717472","caption":"Classic checkout: a postal code with a single colonia selects it automatically. The postal code field is shown before the street for Mexico."},{"src":"https:\/\/ps.w.org\/postali-codigos-postales\/assets\/screenshot-3.png?rev=3717472","caption":"Settings under WooCommerce &gt; Settings &gt; Postali."}],"raw_content":"<!--section=description-->\n<p>Your customers type their <strong>postal code (c\u00f3digo postal)<\/strong> and the WooCommerce checkout fills in the <strong>state<\/strong>, the <strong>city or municipality<\/strong>, and shows a <strong>dropdown with every colonia (neighborhood)<\/strong> for that postal code. Fewer typos, fewer parcels returned for incomplete addresses.<\/p>\n\n<p>The data comes from the official SEPOMEX catalog (Correos de M\u00e9xico), served by the free public <a href=\"https:\/\/postali.app\/api\">Postali API<\/a>: no signup, no API key, no quotas.<\/p>\n\n<p>The plugin interface is in Spanish, since it is built for stores that sell in Mexico.<\/p>\n\n<h4>Features<\/h4>\n\n<ul>\n<li>When the country is <strong>Mexico<\/strong> and the customer types a 5-digit postal code, it fills the state (using WooCommerce's state codes), the city (municipality or alcald\u00eda) and turns the colonia field into a dropdown.<\/li>\n<li>If the postal code has a single colonia, it is selected automatically.<\/li>\n<li>An <strong>\"Otra (escribirla a mano)\"<\/strong> option lets customers type a colonia that is not in SEPOMEX yet. Every field can still be edited by hand.<\/li>\n<li>Works for billing and shipping, and on <strong>My Account &gt; Addresses<\/strong>.<\/li>\n<li>If the API is unreachable or the postal code does not exist, the customer sees a short message and fills the address manually. <strong>A network failure never blocks checkout.<\/strong><\/li>\n<li>Per-session browser cache, so the same postal code is not requested twice.<\/li>\n<li><strong>Optional server-side validation<\/strong>: when the order is placed, reject postal codes that do not exist or that do not match the selected state. Results are cached for a week. If the API does not answer, the order goes through.<\/li>\n<li>Optionally moves the postal code field before the street fields for Mexico, so customers type it first.<\/li>\n<li>Compatible with HPOS (High-Performance Order Storage).<\/li>\n<\/ul>\n\n<h4>Where the colonia is stored<\/h4>\n\n<p>By default, in <strong>Address line 2<\/strong> (<code>address_2<\/code>), relabeled \"Colonia\" for Mexico. This is the most common convention in Mexican stores: line 1 holds street and number, line 2 holds the colonia. The colonia then shows up with no extra setup in emails, invoices, shipping labels, exports and any integration that reads the standard WooCommerce address.<\/p>\n\n<p>If you prefer a separate field, choose <strong>\"Campo propio Colonia\"<\/strong> in the settings. It is stored as an additional order field (<code>_wc_billing\/postali\/colonia<\/code> and <code>_wc_shipping\/postali\/colonia<\/code>, the same format the block checkout uses), and it is added to the formatted Mexican address in the order screen, emails and the thank-you page. Keep in mind that many shipping integrations only read <code>address_2<\/code>.<\/p>\n\n<h4>Classic checkout and block checkout<\/h4>\n\n<ul>\n<li><strong>Classic checkout<\/strong> (<code>[woocommerce_checkout]<\/code> shortcode): fully supported.<\/li>\n<li><strong>Block checkout<\/strong>: supported. State, city and colonia are written to the checkout data store (<code>wc\/store\/cart<\/code>), so the React form and the server see the same values. The colonia dropdown appears right below the postal code field, using the same markup as WooCommerce's own selects. Because the block checkout does not allow replacing its fields, the dropdown is the plugin's own element and writes into Address line 2 (or into the separate \"Colonia\" field, registered through WooCommerce's additional checkout fields API and shown only for Mexico on WooCommerce 9.9+). If a theme or plugin heavily customizes the block form, state and city autocompletion keep working even if the dropdown cannot be inserted.<\/li>\n<\/ul>\n\n<h4>Settings<\/h4>\n\n<p>Under <strong>WooCommerce &gt; Settings &gt; Postali<\/strong>:<\/p>\n\n<ul>\n<li>Turn autocompletion on or off.<\/li>\n<li>Which fields to fill: state, city, colonia.<\/li>\n<li>What goes into \"City\": municipality\/alcald\u00eda (recommended for carriers) or the SEPOMEX city.<\/li>\n<li>Where to store the colonia: Address line 2 or a separate field.<\/li>\n<li>Show the postal code before the street (Mexico).<\/li>\n<li>Server-side validation.<\/li>\n<li>\"Datos: Postali\" credit link (off by default).<\/li>\n<\/ul>\n\n<h4>Optional credit link<\/h4>\n\n<p>The plugin can show a small \"Datos: Postali\" link below the colonia field. <strong>It is off by default<\/strong> and only appears if you turn it on in the settings. The plugin works exactly the same without it.<\/p>\n\n<h3>External services<\/h3>\n\n<p>This plugin connects to the <strong>Postali API<\/strong> (https:\/\/postali.app), an external service, to look up the state, municipality and colonias of a Mexican postal code. Without this lookup the plugin cannot autocomplete the address.<\/p>\n\n<p><strong>What is sent, and when<\/strong><\/p>\n\n<ul>\n<li><strong>From the customer's browser<\/strong>, on the checkout page and on My Account &gt; Addresses: when the country is Mexico and the customer types a 5-digit postal code, the browser requests <code>https:\/\/postali.app\/api\/v1\/mx\/cp\/{postal code}<\/code>. Only the postal code is sent, as part of the URL. As with any web request, the service also receives the customer's IP address and browser user agent. No name, street, email, phone or order data is sent. The request is made without cookies.<\/li>\n<li><strong>From the store's server<\/strong>, only if \"Validaci\u00f3n en el servidor\" is enabled: when an order with a Mexican address is placed, WordPress requests the same URL with that address's postal code. Only the postal code is sent; the response is cached for one week.<\/li>\n<\/ul>\n\n<p>The service is provided by Postali. Terms of use: https:\/\/postali.app\/terminos \u2014 Privacy policy: https:\/\/postali.app\/privacidad \u2014 Documentation: https:\/\/postali.app\/api\/docs<\/p>\n\n<p>Postal code data comes from SEPOMEX (Servicio Postal Mexicano).<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Install and activate WooCommerce.<\/li>\n<li>Upload the <code>postali-codigos-postales<\/code> folder to <code>\/wp-content\/plugins\/<\/code>, or install it from <strong>Plugins &gt; Add New<\/strong>.<\/li>\n<li>Activate the plugin.<\/li>\n<li>Review <strong>WooCommerce &gt; Settings &gt; Postali<\/strong>. It works out of the box: it fills state, city and colonia, and stores the colonia in Address line 2.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"do%20i%20need%20an%20api%20key%20or%20an%20account%3F\"><h3>Do I need an API key or an account?<\/h3><\/dt>\n<dd><p>No. The Postali API is public and free.<\/p><\/dd>\n<dt id=\"what%20happens%20if%20the%20api%20does%20not%20respond%3F\"><h3>What happens if the API does not respond?<\/h3><\/dt>\n<dd><p>The customer sees a notice and fills the address manually. Checkout is never blocked by a network failure, not even with server-side validation enabled.<\/p><\/dd>\n<dt id=\"why%20is%20ciudad%20de%20m%C3%A9xico%20stored%20with%20the%20code%20%22df%22%3F\"><h3>Why is Ciudad de M\u00e9xico stored with the code \"DF\"?<\/h3><\/dt>\n<dd><p>That is the code WooCommerce uses internally for Ciudad de M\u00e9xico (\"MX\" is Estado de M\u00e9xico). The plugin maps SEPOMEX state names to those codes; customers only see the name.<\/p><\/dd>\n<dt id=\"a%20colonia%20is%20missing%20from%20the%20list\"><h3>A colonia is missing from the list<\/h3><\/dt>\n<dd><p>Choose \"Otra (escribirla a mano)\" and type it. SEPOMEX takes a while to register new developments.<\/p><\/dd>\n<dt id=\"does%20it%20work%20for%20colombia%20or%20spain%3F\"><h3>Does it work for Colombia or Spain?<\/h3><\/dt>\n<dd><p>The Postali API also has data for Colombia and Spain, but this version of the plugin only autocompletes Mexican addresses.<\/p><\/dd>\n<dt id=\"can%20i%20point%20it%20at%20my%20own%20copy%20of%20the%20api%3F\"><h3>Can I point it at my own copy of the API?<\/h3><\/dt>\n<dd><p>Yes. The <code>postali_cp_api_base<\/code> PHP filter changes the base URL for both the browser lookups and the server-side validation.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>First release: state, city and colonia autocompletion from the postal code in the classic checkout, the block checkout and My Account; optional server-side validation; optional credit link, off by default.<\/li>\n<\/ul>","raw_excerpt":"Autocomplete Mexican addresses (state, city, colonia) from the postal code at WooCommerce checkout, using the free Postali API. No API key.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/nl-be.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/376677","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nl-be.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/nl-be.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/nl-be.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=376677"}],"author":[{"embeddable":true,"href":"https:\/\/nl-be.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/gomflo"}],"wp:attachment":[{"href":"https:\/\/nl-be.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=376677"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/nl-be.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=376677"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/nl-be.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=376677"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/nl-be.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=376677"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/nl-be.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=376677"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/nl-be.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=376677"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}