Description
Torod Saudi Commerce Tools for ZATCA (by Torod, the team behind the SA Commerce Pro service) gives WooCommerce stores in Saudi Arabia the local features shoppers expect, in Arabic and English, on the classic and the block checkout.
Short National Address
Saudi shoppers know their 8-character short address (for example RRRD2929) better than their full address.
- Adds a Short address field for Saudi addresses on the checkout (classic and block), in My Account and on the admin order screen. It is shown only when the country is Saudi Arabia.
- Address lookup (with an SA Commerce Pro account): type the short address and the building number, street, district, city, region and postcode are filled in for you. Lookups are cached on your site for 30 days, so the same address never uses a second credit.
- Optional: make it required for orders to Saudi Arabia.
- Saved with the order (HPOS compatible) and shown in addresses, order emails and My Account.
- Sent to the Torod shipping plugin with each shipment, so couriers get the exact address.
ZATCA Phase 1 QR code (free)
- Creates the QR code required on simplified tax invoices: seller name, VAT number, invoice date, total with VAT and VAT amount (Base64 TLV, as ZATCA specifies).
- Shown on the order received page, in My Account › Orders, in customer emails, on the admin order screen (with a PNG download), in PDF invoices from “PDF Invoices & Packing Slips for WooCommerce”, and on invoices and receipts from “Print Invoice & Delivery Notes for WooCommerce”.
- Any other invoice template: the
[sacp_zatca_qr]shortcode or thesacp_zatca_qraction. The settings screen tells you when an active invoice plugin doesn’t include the QR yet. - Each invoice is frozen when the order is paid, so later edits never change a QR code already given to the customer.
- You choose the first date that gets a QR (by default, the day you turn it on), so older orders from before your VAT registration or a name change are not given a new, different QR.
- Made on your own server: no account, no API call, nothing sent anywhere.
Sign in with a code
- Customers sign in or create an account with their Saudi mobile number and an SMS code, or sign in with a 6-digit code sent to their email (free).
- Existing customers whose number is saved on their account confirm it with the SMS code and a code sent to the account’s email; the number is then added, and earlier guest orders with the same email and mobile number move to the account (on by default, up to 30 orders).
- The Users list shows each customer’s verified mobile number (and finds customers by it), and the Orders list marks orders placed with it.
- Customers add, change or remove their mobile number in My Account. Changes ask them to confirm it’s them first, and the account email is told.
- Built for security: codes are rate-limited, numbers are locked after too many wrong codes (an admin can unlock them), and accounts are never taken over through an email or phone number someone else typed.
- Administrators, shop managers and editors always sign in with their password.
- One clear way in: in My Account, new accounts are created only after a code (mobile, or email when email codes are on), and WooCommerce’s email and password sign-up form is hidden (when no code can be sent, it comes back). WooCommerce’s “Create an account” box at checkout keeps working, unless you choose “Existing customers only”. Stores updating from 4.0 keep their current sign-up until they switch.
- Customers who try a password with their mobile number, or reset the password of an account created with a mobile number, are pointed to the code sign-in. Optionally show the password sign-in as a link under the mobile form.
- Shortcode
[sacp_otp_login]for a custom sign-in page.
Cash on delivery: verify the mobile number
Fewer refused cash-on-delivery parcels: before a cash-on-delivery order is placed, the shopper confirms their mobile number with an SMS code.
- Works on the classic checkout, the Checkout block and the “Pay for order” page.
- When SMS can’t be sent (no credit, service down), the order goes through marked “not verified”. When your daily SMS limit is reached, you choose: let it through the same way, or ask the shopper to choose another payment method.
- The result and its reason are shown in the Orders list, on the order screen and as an order note.
Company VAT number (optional)
For business customers: an optional “Company VAT number” field at checkout (classic and block) and in My Account. It checks the Saudi format (15 digits starting and ending with 3, Arabic digits accepted), can be required when a company name is entered (classic checkout), and is shown on the order, in emails and to invoice plugins (order meta _billing_vat_number). Off by default: turn it on under SA Commerce Pro › ZATCA QR code › Business customers. It stays off when another VAT plugin (EU VAT Number, EU VAT Assistant, Germanized Pro) already adds one.
Phone-first checkout (optional)
A checkout that starts with the mobile number and an SMS code; the email only if the customer wants one.
- Signed-out shoppers enter their mobile number and an SMS code before the checkout. Returning customers are signed in; new customers give their first and last name and their account is created right then, with no password, so their cart stays saved if they don’t finish.
- Customers with a password sign in with it on the same step (if the number is only the billing phone of an older account, a code goes to that account’s email and the number is added; someone whose old or recycled number is on another person’s account continues with their email); shoppers without a Saudi mobile number continue with their email; with “guests allowed” a “Continue as a guest” link is shown.
- Never locks the checkout: when no code can be sent (daily SMS limit, no credit, service down), shoppers continue to the normal checkout. Checkout pages that a funnel or page builder renders without WooCommerce’s checkout shortcode or block don’t show the step and keep working.
- Email at checkout for customers signed in with their mobile number: required, optional (“Email for your invoice”) or hidden until needed (classic checkout; the Checkout block always asks for an email). Without one, the order keeps a stand-in address made from the number (9665XXXXXXXX@phone.invalid): customers don’t see it at checkout or on their order pages, and no email is ever sent to it. Guests always give their email.
- Payment methods that need the buyer’s email (Tabby and Tamara by default) ask for it when chosen.
- A short reminder to add or confirm the email on the order received page and in My Account.
- Optional: right after they sign in, ask customers who have no verified mobile number to confirm one before the checkout (“Skip for now” hides it for 30 days; never blocks an order).
- Off by default (“Standard WooCommerce checkout”). About one SMS per sign-in or new customer.
Made for Saudi stores
- Arabic and English included; every screen works right-to-left.
- All texts are translatable (WPML, Polylang, TranslatePress, Loco Translate).
- Works with page caching and script optimisers (LiteSpeed Cache, WP Rocket, Perfmatters, Cloudflare).
- Personal data export and erase for mobile numbers and short addresses; suggested privacy policy text.
Free and paid features
The short address field and the ZATCA QR code are free and work without an account. Address lookup and SMS codes use credits from an SA Commerce Pro plan: connect your store with the site key from your SA Commerce Pro dashboard (https://ext.torod.co › Store Integration). Email sign-in codes and the company VAT number field are free.
External services
This plugin connects to the SA Commerce Pro Store API, operated by Torod, only after you connect your store with a site key. Nothing is sent before that.
What the service is for: it is Torod’s service behind three features of this plugin. It finds the full Saudi National Address for a short address typed at checkout or in My Account, it sends and checks the SMS codes used for mobile sign-in and the cash-on-delivery number check, and it tells the plugin which features and balances your plan includes. Without a connection those features stay off; the rest of the plugin works without it.
- Connect / refresh (when you connect, once a day while connected, and every 30 minutes while a balance is 0): sends your store URL, store name, admin email, locale, timezone, WordPress / WooCommerce / PHP / plugin versions, and this site’s webhook address and secret. Returns your plan and balances.
- Address lookup (when a shopper types a short address, if lookup is on): sends the short address and the page language. Returns the National Address. Nothing else about the shopper is sent.
- SMS codes (when a shopper asks for a code, if SMS sign-in or the cash-on-delivery check is on): sends the mobile number and your store URL to send the code, then the number and the code the shopper typed to check it.
- Webhooks: the service sends plan, bundle and balance updates to this site, signed with HMAC-SHA256 over a timestamp and the body; old or repeated deliveries are refused.
Every call carries your site key in the request headers. It identifies your store and is never shown to shoppers.
Service: https://api.ext.torod.co (dashboard: https://ext.torod.co). Terms of use: https://torod.co/en/terms-and-conditions. Privacy policy: https://torod.co/en/privacy-policy.
The ZATCA QR code and email sign-in codes are created on your site and send nothing to the service.
Credits
- QR code generator based on Project Nayuki’s QR Code generator library (MIT License).
- Fonts: Plus Jakarta Sans, Tajawal, IBM Plex Mono (SIL Open Font License 1.1, see assets/fonts).
Installation
- Install and activate the plugin. WooCommerce must be active.
- Go to SA Commerce Pro in the admin menu.
- National Address: turn on the short address field (and, if you like, make it required).
- ZATCA QR code: enter your seller name and your 15-digit VAT number, then turn it on.
- Optional: under Store connection, paste the site key from your SA Commerce Pro dashboard (https://ext.torod.co › Store Integration) to turn on address lookup and SMS codes.
- Sign in with a code: choose the sign-in options and, if you take cash on delivery, the mobile number check.
- Checkout experience (optional): choose a checkout mode (mobile number first) and whether customers signed in with their mobile number must give an email.
- Optional: ZATCA QR code › Business customers adds a company VAT number field for B2B buyers.
FAQ
Do I need an SA Commerce Pro account?
No. The short address field, the ZATCA QR code, email sign-in codes and the company VAT field work without one. An account is needed only for address lookup and SMS codes, which use credits.
Does the QR code make my store fully ZATCA compliant?
It covers the Phase 1 (generation phase) QR code on simplified tax invoices. Phase 2 (integration with ZATCA’s FATOORAH platform) needs more steps and will be offered as a separate service.
Which orders get a QR code?
Paid orders (processing or completed) in Saudi riyals, paid on or after the “Add the QR to orders from” date, once you have entered your seller name and VAT number. The date is set to the day you first turn the QR code on; move it back to cover older orders. Stores that used the QR code before this setting existed keep it for all orders. An order that already has a QR always keeps it.
My invoice plugin or template doesn’t show the QR code.
The QR is added automatically to “PDF Invoices & Packing Slips for WooCommerce” and “Print Invoice & Delivery Notes for WooCommerce”. For any other invoice plugin or a custom template:
- Shortcode:
[sacp_zatca_qr]on the “Order received” or “View order” page, or[sacp_zatca_qr order_id="123"]elsewhere. Options:size="130"(pixels) anddetails="no"(QR only, without the invoice details). It shows only to staff who can edit orders, the order’s own customer, or with the order key (key="…", or?key=in the page address), so it never shows another customer’s invoice. - PHP, in an invoice template:
do_action( 'sacp_zatca_qr', $order, array( 'size' => 130, 'details' => true ) );prints the same block (the template decides who sees the document).TorodCo\SACommercePro\Zatca\Zatca_Module::qr_data_uri( $order )returns just the QR as a PNG data URI.
Both print nothing while the QR code is off or when the order doesn’t get one (not paid, not in SAR, or before the “Add the QR to orders from” date). The admin order screen also has a “Download PNG” link.
Does it work with the block checkout?
Yes. The short address field, address lookup and the cash-on-delivery check work on the classic checkout and the Checkout block. The cash-on-delivery check also works on the “Pay for order” page. The phone-first checkout’s mobile number step works on both; the optional or hidden email applies to the classic checkout only (the Checkout block always asks for an email).
My existing customers want to sign in with their mobile number. What happens?
For security, a mobile number signs in only after it is verified with a code. If the number is already saved as the billing phone of one customer account, the customer enters the SMS code and then a code sent to that account’s email, and the number is added to the account (SA Commerce Pro › Sign in with a code › “Customers whose number is already on an account”). You can choose “Password only” instead, or treat the number as new. A number saved on more than one account is never linked: those customers sign in with their email or password, then add the number in My Account › Account details.
What happens when my SMS credit runs out?
Sign-in by SMS pauses; customers can still sign in with email codes or their password. Cash-on-delivery orders go through marked “not verified”. A daily SMS limit protects your credits; when it is reached, you choose whether cash-on-delivery orders go through or shoppers choose another payment method.
What does the phone-first checkout change for my store?
Nothing until you choose a mode under SA Commerce Pro › Checkout experience. With it on, signed-out shoppers see a mobile number step before the checkout form, and new customers get an account (mobile number, first and last name) when they enter the code. Customers who give no email keep a stand-in address on their orders that is never mailed; they can add a real email later in My Account. If WooCommerce deletes inactive accounts (Accounts & Privacy), accounts created at that step without an order can be deleted after that period.
Can staff sign in with a code?
No. Administrators, shop managers and editors always use their password.
Where is the short address stored?
On the order as _billing_sacp_short_address / _shipping_sacp_short_address, and on the customer as billing_sacp_short_address / shipping_sacp_short_address. Block checkout orders also keep WooCommerce’s own field _wc_billing/sa-commerce-pro/short-address.
Does it work with page caching and script optimisers?
Yes. The sign-in page from the shortcode is never cached, and if a cached page holds an expired security token the plugin fetches a fresh one. Its scripts are marked so LiteSpeed, WP Rocket, Perfmatters and Cloudflare Rocket Loader don’t delay them. When a setting changes what the sign-in forms show, the plugin clears the page cache of LiteSpeed, WP Rocket, W3 Total Cache, WP Super Cache, SiteGround, Breeze and WP Fastest Cache. After updating the plugin, purge your cache once if your optimiser removes version numbers from script URLs.
My store is behind a proxy or load balancer.
Visitors behind Cloudflare are recognised automatically. For another proxy, add its IP or range with the sacp_trusted_proxies filter, so rate limits count each visitor separately.
Which hooks can developers use?
Sign-in and sign-up:
* sacp_signup_code_only (filter): keep WooCommerce’s own register form on My Account (code-only off).
* sacp_code_signup_registration_checks (filter): run WooCommerce’s registration checks for accounts created after a code (default yes).
* sacp_is_captcha_error (filter): which refusals count as CAPTCHA refusals (ignored after a verified code).
* sacp_email_signup_per_hour (filter): store-wide cap on email sign-up codes per hour (default 60).
* sacp_otp_limit_per_hour (filter): code requests per visitor per hour.
* sacp_otp_login_roles, sacp_otp_can_login, sacp_otp_before_sign_in (filters): who may sign in with a code alone, and a last refusal for security plugins.
* sacp_otp_tab_classes, sacp_primary_button_class (filters): reuse the theme’s tab and button classes.
* sacp_phone_linked, sacp_phone_unlinked (actions): a verified mobile number was added to or removed from an account.
* sacp_cart_merge_notice (filter): turn off the “We added N items saved in your account” notice.
Checkout and cash on delivery:
* sacp_phone_checkout_enforce (filter): refuse signed-out orders that skipped the phone-first checkout’s mobile step.
* sacp_checkout_email_gateways (filter): payment methods that need a real email.
* sacp_cod_payment_methods (filter): payment methods treated as cash on delivery.
* sacp_allow_guest_without_cart (filter): let guests use paid features with an empty cart (custom sign-in pages).
Address, ZATCA and connection:
* sacp_lookup_limit_per_hour (filter): address lookups per visitor per hour.
* sacp_zatca_qr_applies, sacp_zatca_email_image, sacp_zatca_unsupported_invoice_plugins (filters), sacp_zatca_qr (action and shortcode): the QR code on orders, emails and invoice templates.
* sacp_trusted_proxies, sacp_cloudflare_ranges (filters): proxies whose forwarded visitor IP is trusted.
* sacp_api_base_url, sacp_api_timeout, sacp_http_transport (filters): service address, timeout and transport (tests).
* sacp_webhook_plan (action): the plan changed through a signed webhook.
* sacp_purge_page_cache (action): fires when cached pages must be dropped; hook your page cache here if it isn’t LiteSpeed, WP Rocket, W3 Total Cache, WP Super Cache, SiteGround, Breeze or WP Fastest Cache.
* sacp_debug_log (filter): debug logging.
I copied my store to a staging site.
The connection belongs to the address it was made from. On a copy at another address (or another folder), address lookup and SMS codes stay off, so the copy never uses your credits or texts real customers. Connect the copy with its own site key to test them.
Screenshots








Changelog
4.1.0
- New: “How customers create accounts”: only with a code (new stores) or also with email and password (stores updating from 4.0). In code-only mode the My Account register form’s Email tab sends an email code and creates the account with a confirmed email; if no code can be sent, WooCommerce’s form comes back.
- New: “Who can create an account”: follow WooCommerce, always (with a code) or existing customers only (this also closes “Create an account” at checkout, including posted checkout forms).
- New: after a failed password sign-in, a hint to sign in with the mobile number; a mobile number typed as the username opens the mobile form with it; the lost-password form explains how accounts created with a mobile number sign in, and sends no reset mail to an account without an email.
- New: “Password sign-in” as a tab or as a link under the mobile form.
- New (phone-first checkout, off by default): also ask signed-in customers without a verified mobile number.
- New: a notice when signing in adds the items saved on the account to the cart.
- Desktop sign-in pages with sign-in and register side by side show the mobile form once.
- The page cache is cleared for more cache plugins (W3 Total Cache, WP Super Cache, SiteGround, Breeze, WP Fastest Cache, or any cache through the
sacp_purge_page_cacheaction), and when WooCommerce’s sign-up option or the active plugins change. - Sign-up codes: a code is never sent for a request that couldn’t be saved, and a used code can’t come back after a resend; the Health box says when another plugin refuses code sign-ups.
- Compatibility: code-only sign-up keeps WooCommerce’s form when another plugin adds its own fields to it (vendor, B2B, newsletter or consent fields), and ignores CAPTCHA refusals after a verified code. “Existing customers only” also hides WooCommerce’s register form and closes “Create an account” at checkout.
- Fix: sign-in codes stay valid for their full 10 minutes on sites with a small shared object cache (they could read as “expired” after a minute or two).
- Admin: cash-on-delivery settings say when no cash-on-delivery method is enabled; hint for customers whose email was never confirmed. Optional checkout email says why to add it.
4.0.0
- First release on WordPress.org. A complete rebuild of the earlier “Saudi Commerce Pro” plugin (a notice offers to deactivate the old one; your site key is kept).
- Short National Address field with lookup on the classic and block checkout, My Account and the order screen; sent to Torod.
- Free ZATCA Phase 1 QR code on the order page, emails, My Account, the admin order screen and PDF invoices.
- Sign in or sign up with a mobile number (SMS code) or an email code; mobile number in My Account; existing customers link a saved number with an email code; email confirmation.
- Cash-on-delivery mobile verification with the result and reason on every order.
- Optional phone-first checkout (mobile number and SMS code before the checkout, email optional).
- Optional company VAT number field for business customers (checkout, My Account, order, emails).
- ZATCA: “Add the QR to orders from” date, Print Invoice & Delivery Notes support,
[sacp_zatca_qr]shortcode andsacp_zatca_qraction. - Arabic and English, right-to-left, HPOS, privacy export and erase.
