{"id":292506,"date":"2026-04-06T05:59:06","date_gmt":"2026-04-06T05:59:06","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/bsale-dte\/"},"modified":"2026-04-06T05:58:50","modified_gmt":"2026-04-06T05:58:50","slug":"pwl-dte-for-bsale","status":"publish","type":"plugin","link":"https:\/\/bal.wordpress.org\/plugins\/pwl-dte-for-bsale\/","author":14755812,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"2.0.7","stable_tag":"2.0.7","tested":"6.9.4","requires":"6.0","requires_php":"8.0","requires_plugins":null,"header_name":"PWL DTE for Bsale","header_author":"PluginLATAM","header_description":"Integraci\u00f3n WooCommerce con Bsale para facturaci\u00f3n electr\u00f3nica chilena","assets_banners_color":"ffffff","last_updated":"2026-04-06 05:58:50","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/github.com\/PluginLATAM\/PWL-dte-for-bsale-lite","header_author_uri":"https:\/\/github.com\/PluginLATAM","rating":0,"author_block_rating":0,"active_installs":0,"downloads":25,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"2.0.7":{"tag":"2.0.7","author":"userdm","date":"2026-04-06 05:58:50"}},"upgrade_notice":{"2.0.0":"<p>Plugin renamed to PWL DTE for Bsale. All internal identifiers updated for WordPress.org trademark compliance.<\/p>"},"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3499857,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3499857,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3499857,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3499857,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["2.0.7"],"block_files":[],"assets_screenshots":[],"screenshots":{"1":"Plugin settings \u2014 Connection tab","2":"Checkout with electronic invoice fields","3":"\"Bsale \u2014 Tax Document\" metabox on the order","4":"DTE Logs page with filters"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[259495,19289,259497,259496,286],"plugin_category":[45],"plugin_contributors":[259498],"plugin_business_model":[],"class_list":["post-292506","plugin","type-plugin","status-publish","hentry","plugin_tags-bsale","plugin_tags-chile","plugin_tags-dte","plugin_tags-electronic-invoicing","plugin_tags-woocommerce","plugin_category-ecommerce","plugin_contributors-userdm","plugin_committers-userdm"],"banners":{"banner":"https:\/\/ps.w.org\/pwl-dte-for-bsale\/assets\/banner-772x250.png?rev=3499857","banner_2x":"https:\/\/ps.w.org\/pwl-dte-for-bsale\/assets\/banner-1544x500.png?rev=3499857","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/pwl-dte-for-bsale\/assets\/icon-128x128.png?rev=3499857","icon_2x":"https:\/\/ps.w.org\/pwl-dte-for-bsale\/assets\/icon-256x256.png?rev=3499857","generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p><strong>PWL DTE for Bsale<\/strong> connects your WooCommerce store with <a href=\"https:\/\/www.bsale.cl\/\">Bsale<\/a>, the leading electronic invoicing and point-of-sale platform in Chile. When an order is completed, the plugin automatically generates the corresponding tax document (boleta or factura electr\u00f3nica) and submits it to the SII.<\/p>\n\n<h4>Key Features<\/h4>\n\n<ul>\n<li><strong>Automatic boleta electr\u00f3nica<\/strong> \u2014 generated when an order is completed (codeSii 39)<\/li>\n<li><strong>Factura electr\u00f3nica<\/strong> \u2014 customer checks \"I need an invoice\" at checkout and provides their RUT and company name<\/li>\n<li><strong>Real-time RUT validation<\/strong> \u2014 check digit verification with instant feedback<\/li>\n<li><strong>Classic and Blocks checkout compatible<\/strong> \u2014 works with WooCommerce shortcode checkout and the new Blocks checkout (WC 8.6+)<\/li>\n<li><strong>Manual stock sync<\/strong> \u2014 update WooCommerce stock from Bsale with one click<\/li>\n<li><strong>Duplicate prevention<\/strong> \u2014 uses referenceId to avoid issuing the same DTE twice<\/li>\n<li><strong><code>[pwl_dte]<\/code> shortcode<\/strong> \u2014 display the tax document on the order confirmation page or My Account<\/li>\n<li><strong>Sandbox mode<\/strong> \u2014 test without affecting real SII documents<\/li>\n<li><strong>Activity logs<\/strong> \u2014 detailed record of every DTE issued with status and folio number<\/li>\n<\/ul>\n\n<h4>Requirements<\/h4>\n\n<ul>\n<li>WordPress 6.0 or higher<\/li>\n<li>WooCommerce 8.0 or higher<\/li>\n<li>PHP 8.0 or higher<\/li>\n<li>Active <a href=\"https:\/\/www.bsale.cl\/\">Bsale<\/a> account with API token<\/li>\n<\/ul>\n\n<h4>Lite vs Pro<\/h4>\n\n<p>The free (Lite) edition includes boleta, factura, checkout fields, manual stock sync, and DTE shortcode.<\/p>\n\n<p>The Pro version adds: automatic cron-based stock sync, dedicated stock office, multi-office support (shipping method \u2192 office mapping), automatic retry for failed DTEs, real-time webhooks, and credit notes on refunds.<\/p>\n\n<h3>External Services<\/h3>\n\n<p>This plugin connects to the <a href=\"https:\/\/www.bsale.cl\/\">Bsale API<\/a> to generate and manage electronic tax documents (DTEs) required by Chilean tax law (SII).<\/p>\n\n<h4>What data is sent and when<\/h4>\n\n<ul>\n<li>When a WooCommerce order is completed, the order details (products, quantities, prices, and customer billing information such as RUT and company name) are sent to Bsale to create a tax document (boleta or factura electr\u00f3nica).<\/li>\n<li>When manual stock sync is triggered by the store admin, product SKUs are sent to retrieve current stock levels from Bsale.<\/li>\n<li>When testing the API connection from the settings page, a simple request is made to verify the token is valid. No customer data is sent.<\/li>\n<\/ul>\n\n<h4>Service information<\/h4>\n\n<ul>\n<li>Bsale website: <a href=\"https:\/\/www.bsale.cl\/\">https:\/\/www.bsale.cl\/<\/a><\/li>\n<li>Bsale API documentation: <a href=\"https:\/\/docs.bsale.dev\/\">https:\/\/docs.bsale.dev\/<\/a><\/li>\n<li>API hosts used by this plugin:\n\n<ul>\n<li>Default API base URL used by the client: <code>https:\/\/api.bsale.io\/v1\/<\/code><\/li>\n<li>Additional v2 endpoint usage (for product import and webhook resource reads): <code>https:\/\/api.bsale.io\/v2\/<\/code><\/li>\n<\/ul><\/li>\n<li>Terms of service: <a href=\"https:\/\/www.bsale.cl\/sheet\/condiciones-uso\">https:\/\/www.bsale.cl\/sheet\/condiciones-uso<\/a><\/li>\n<li>Privacy policy: <a href=\"https:\/\/www.bsale.cl\/sheet\/politica-privacidad\">https:\/\/www.bsale.cl\/sheet\/politica-privacidad<\/a><\/li>\n<\/ul>\n\n<h3>Source Code and Build Tools<\/h3>\n\n<p>This plugin includes generated production assets under <code>assets\/<\/code> (for example <code>assets\/admin\/js\/admin.js<\/code> and <code>assets\/public\/js\/checkout*.js<\/code>).<\/p>\n\n<p>The non-compiled source code is publicly available in the project repository:<\/p>\n\n<ul>\n<li>Source repository: <a href=\"https:\/\/github.com\/PluginLATAM\/PWL-dte-for-bsale-lite\">https:\/\/github.com\/PluginLATAM\/PWL-dte-for-bsale-lite<\/a><\/li>\n<li>JavaScript\/CSS source files: <code>resources\/admin\/<\/code> and <code>resources\/public\/<\/code><\/li>\n<li>Build configuration: <code>package.json<\/code>, <code>vite.config.js<\/code>, <code>tailwind.config.js<\/code>, <code>postcss.config.js<\/code><\/li>\n<\/ul>\n\n<p>To build assets locally:<\/p>\n\n<ol>\n<li>Install dependencies: <code>npm install<\/code><\/li>\n<li>Development\/watch mode: <code>npm run dev<\/code><\/li>\n<li>Production assets build: <code>npm run build<\/code><\/li>\n<\/ol>\n\n<!--section=installation-->\n<ol>\n<li>Upload the plugin to <code>\/wp-content\/plugins\/pwl-dte-for-bsale\/<\/code> or install it directly from the WordPress plugin directory.<\/li>\n<li>Activate the plugin from the <strong>Plugins<\/strong> menu in WordPress.<\/li>\n<li>Go to <strong>PWL DTE \u2192 Settings<\/strong> and enter your Bsale API token.<\/li>\n<li>Select the mode (Sandbox or Production) and the issuing office.<\/li>\n<li>Click <strong>Test Connection<\/strong> to verify the token is valid.<\/li>\n<li>Done! DTEs will be generated automatically when orders are completed.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"do%20i%20need%20a%20bsale%20account%3F\"><h3>Do I need a Bsale account?<\/h3><\/dt>\n<dd><p>Yes. This plugin requires an active <a href=\"https:\/\/www.bsale.cl\/\">Bsale<\/a> account and an API token with permission to issue documents.<\/p><\/dd>\n<dt id=\"does%20it%20work%20in%20sandbox%20mode%3F\"><h3>Does it work in sandbox mode?<\/h3><\/dt>\n<dd><p>Yes. In <strong>Settings \u2192 Connection<\/strong> you can enable Sandbox mode to test without issuing real documents to the SII.<\/p><\/dd>\n<dt id=\"what%20happens%20if%20dte%20generation%20fails%3F\"><h3>What happens if DTE generation fails?<\/h3><\/dt>\n<dd><p>The error is recorded in <strong>PWL DTE \u2192 DTE Logs<\/strong> with the Bsale error message. You can retry manually from the order metabox in the WooCommerce admin.<\/p><\/dd>\n<dt id=\"is%20it%20compatible%20with%20woocommerce%20blocks%20checkout%3F\"><h3>Is it compatible with WooCommerce Blocks checkout?<\/h3><\/dt>\n<dd><p>Yes. The RUT, Company Name, and Business Activity fields work with both the classic checkout ([woocommerce_checkout]) and the Blocks checkout (WC 8.6+).<\/p><\/dd>\n<dt id=\"does%20the%20plugin%20deduct%20stock%20in%20bsale%3F\"><h3>Does the plugin deduct stock in Bsale?<\/h3><\/dt>\n<dd><p>Yes, if the option is enabled in settings. You can control this via the dispatch parameter in the document settings.<\/p><\/dd>\n<dt id=\"where%20can%20i%20see%20generated%20dtes%3F\"><h3>Where can I see generated DTEs?<\/h3><\/dt>\n<dd><p>Each WooCommerce order has a \"Bsale \u2014 Tax Document\" metabox showing the document type, folio, status, and links to the PDF and public URL. You can also view the full history in <strong>PWL DTE \u2192 DTE Logs<\/strong>.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>2.0.7<\/h4>\n\n<ul>\n<li>Removed automatic cross-plugin deactivation logic to comply with WordPress.org activation policy (users now resolve Lite\/Pro conflicts manually).<\/li>\n<li>Finalized 2.0.7 consistency updates across plugin metadata and release docs.<\/li>\n<\/ul>\n\n<h4>2.0.6<\/h4>\n\n<ul>\n<li>Resolved Plugin Check scanner findings by tightening prepared-query handling in webhook event queries.<\/li>\n<li>Replaced legacy runtime logging calls with WooCommerce logger integration for production-safe logs.<\/li>\n<li>Improved release\/build consistency and metadata validation (including plugin header URI safeguards and deploy keep-version flow).<\/li>\n<\/ul>\n\n<h4>2.0.5<\/h4>\n\n<ul>\n<li>Hardened WordPress.org review compliance across escaping, admin asset loading, and i18n behavior.<\/li>\n<li>Added runnable Playwright Lite E2E workflow and updated Lite testing documentation.<\/li>\n<\/ul>\n\n<h4>2.0.0<\/h4>\n\n<ul>\n<li>Renamed plugin to PWL DTE for Bsale (slug: pwl-dte-for-bsale) for WordPress.org trademark compliance.<\/li>\n<li>Converted all inline scripts to use wp_add_inline_script() per WordPress best practices.<\/li>\n<li>Added External Services section to readme documenting Bsale API usage.<\/li>\n<\/ul>\n\n<h4>1.0.5<\/h4>\n\n<ul>\n<li>Legacy release prior to the current trademark-compliant plugin naming.<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Fix: In Blocks checkout (WC Blocks), the \"I need an electronic invoice\" field is now read correctly using the _wc_other\/ prefix that WooCommerce Blocks uses internally. This fixes an issue where a Boleta was always generated instead of a Factura when using the Blocks checkout.<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial public release.<\/li>\n<li>Automatic boleta and factura electr\u00f3nica generation on order completion.<\/li>\n<li>RUT, Company Name, and Business Activity fields in checkout (classic and Blocks).<\/li>\n<li>Real-time RUT validation via AJAX.<\/li>\n<li>Manual stock sync from Bsale.<\/li>\n<li>DTE shortcode to display the document on the frontend.<\/li>\n<li>Sandbox mode for testing.<\/li>\n<li>Activity logs with filters.<\/li>\n<\/ul>","raw_excerpt":"Automatically generate electronic tax documents (boletas and facturas) via Bsale when orders are completed in WooCommerce.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/292506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=292506"}],"author":[{"embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/userdm"}],"wp:attachment":[{"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=292506"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=292506"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=292506"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=292506"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=292506"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=292506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}