Turn on Pay on account, approve a customer, take an order on account and record the payment. This guide covers the settings, what the customer sees, how balances and invoices work, the developer hooks and what to check when something does not look right.
Upload demfilz-trade-accounts-for-woocommerce.zip under Plugins → Add New Plugin → Upload Plugin and activate it. WooCommerce must be installed and active (WooCommerce 8.3 or later, WordPress 6.2 or later, PHP 7.4 or later). The plugin adds a Pay on account payment method, a Trade Accounts screen under WooCommerce and a Trade account tab in My Account. It creates no database tables.
Under WooCommerce → Settings → Payments make sure Pay on account is enabled, and set its title and description if you want different wording at checkout. Then open WooCommerce → Trade Accounts → Settings:
| Setting | What it does |
|---|---|
| Default payment terms | Days from the order date until payment is due, for every account without its own terms. 30 by default. |
| Status for orders on account | Processing (ships straight away, the usual arrangement), On hold (you release it) or Completed. The order is not marked paid until you record the payment, whichever you choose. |
| Purchase order number | Do not ask, ask for it (optional) or require it. Shown in the Pay on account box at checkout and stored on the order. |
| Payment instructions | Your bank details and how to reference the payment. Shown on the thank you page, in the order emails and in My Account for unpaid invoices. |
There are three ways an account becomes approved:
| Way | How |
|---|---|
| Add a customer | On the Accounts tab, search for an existing customer, set their terms and click Add and approve. They are emailed that their account is open. |
| Applications | Customers apply from My Account → Trade account (business name, ABN or tax id, phone, a message) or from any page with the [dtaw_apply] shortcode. You get the Trade account application email with an Open link; approve or decline from the Accounts tab, the account view or the customer's user profile. The customer is emailed with the decision. |
| Auto approved roles | In Settings, tick roles that can pay on account without applying, for stores that already give wholesale customers a role. A suspended or declined status still wins. |
Open an account to set its own payment terms, an account reference (the account number in your books, shown to the customer) and internal notes. Suspend an account to stop new orders on account while keeping its history; reinstate it later. Remove record forgets the status and application; orders already placed on account are kept.
| Where | What |
|---|---|
| Checkout | Approved customers see Pay on account with their terms ("Payment is due 30 days from the order date") and the purchase order field. In the checkout block the button reads Place order on account. Nobody else sees the method, and the approval is checked again when the order is placed. |
| Thank you page and emails | "Placed on trade account, due on ..." with the purchase order number and your payment instructions, on the thank you page, in the customer's order email and in the store's new order email. |
| My Account → Trade account | Account status, terms and reference, balance owing, open invoices with due dates and overdue flags, how to pay, and recently paid invoices. Customers without an account see the application form; a pending or declined application shows its status. |
| Action | Where |
|---|---|
| Record a payment | Open the order and use the Trade account box: payment date (today by default), bank reference and a note. The order gets its paid date, an order note and the invoice becomes Paid. Optionally the order is marked Completed (Settings). |
| Paid today | On the Invoices tab, or in the invoice list on an account, records the invoice as paid in full today without opening the order. |
| Mark as unpaid | In the Trade account box on a paid order; reverses the payment, clears the paid date and reopens the invoice. |
| Cancelled, refunded or failed orders | Leave the balance automatically (state Void). A partial refund reduces the amount owing. Restoring a cancelled order reopens the invoice. |
The tiles at the top of the Accounts tab show the balance owing, the overdue amount, what is due in the next 7 days and the number of open invoices for the whole store; the same tiles appear on each account. The Invoices tab lists Unpaid, Overdue, Paid, Void or All invoices, searchable by order number, purchase order number or billing email, with Export CSV for the current view. The orders list gets an On account column (due date, days overdue, paid, with the PO number), the users list a Trade account column, and each user profile a Trade account panel with the status, terms and reference.
| Setting | What it does |
|---|---|
| Auto approved roles | Roles that can pay on account without applying. |
| Applications | Any logged in customer can apply from My Account, or nobody (you add customers yourself; the shortcode form is hidden too). |
| When a payment is recorded | Mark Processing or On hold orders as Completed. |
| Uninstall | Delete account statuses, applications and settings when the plugin is deleted. Invoice details stay on the orders either way, because they are financial records. |
| Gateway title and description | On the Pay on account page under WooCommerce → Settings → Payments. |
| Hook | Use |
|---|---|
dtaw_status_changed, dtaw_order_placed, dtaw_payment_recorded, dtaw_payment_reversed | Actions after an account changes status, an order is placed on account, and a payment is recorded or reversed. |
dtaw_can_place_on_account | Filter: return a WP_Error to refuse an order on account with a message the customer sees (credit limits, holds). |
dtaw_is_approved, dtaw_terms_days, dtaw_due_date | Filters: change who counts as approved, a customer's terms, or the due date of an order. |
dtaw_checkout_extra_text, dtaw_gateway_available, dtaw_open_statuses | Filters: extra lines in the checkout box, gateway availability, and which order statuses count as open. |
dtaw_admin_tabs, dtaw_admin_tiles, dtaw_admin_tab_{tab}, dtaw_account_form_rows, dtaw_admin_account_after | Add tabs, tiles, fields and panels to the Trade Accounts screen. |
dtaw_account_endpoint, dtaw_account_after_status | Change the My Account endpoint slug, or print more under the customer's status. |
Orders placed on account carry the meta _dtaw_on_account (1), _dtaw_state (open, paid or void), _dtaw_due (Y-m-d), _dtaw_terms (days) and _dtaw_po, and once paid _dtaw_paid_at and _dtaw_paid_ref. The customer's status is the user meta _dtaw_status. Email templates live in templates/emails/ and can be copied into yourtheme/woocommerce/emails/.
A customer cannot see Pay on account: they must be logged in and their account must be Approved (check the Accounts tab), or their role must be ticked under Auto approved roles. The method is also hidden on the pay-for-order page, and it must be enabled under WooCommerce → Settings → Payments.
The order shows as paid in a report: only orders with a recorded payment carry a paid date. If an order was moved to Completed by hand before the payment was recorded, record the payment on the order; the paid date is set to the payment date you enter.
The purchase order number is missing: the field is set to Do not ask in Settings, or the customer left it empty while it was optional. Set it to Required if you need one on every order.
No application email arrived: check that the Trade account application email is enabled under WooCommerce → Settings → Emails and that your site sends mail (an SMTP plugin helps). The recipient defaults to the store's admin email and can be changed on that email's settings.
The Trade account tab is missing from My Account: go to Settings → Permalinks and click Save once to refresh the endpoint, and check that Applications is not set to nobody for customers without an account.
What happens if I deactivate or delete the plugin: orders keep their due dates, purchase order numbers and payment details as order meta. Account statuses and applications stay unless you tick the uninstall option in Settings before deleting the plugin.
We build and customise WooCommerce plugins for a living. If your store needs credit limits, statements, wholesale pricing or custom checkout rules, tell us what and we'll quote it.