Clients & portal
Easy Invoice doesn't have a separate "client" CPT — clients are WordPress users. This is intentional: it lets you reuse WordPress login, password reset, and avatars without reinventing them.
How clients are stored
- Storage:
wp_users+wp_usermeta(queried viaincludes/Repositories/ClientRepository.php). - Role:
easy_invoice_client(auto-created on activation; capabilityreadonly). - Listing: Easy Invoice → All Clients — uses
WP_User_Queryfiltered to admins + portal-role users that have invoices.
Some installs may also have legacy
easy_invoice_clientpost type data from older versions — Reports still considers it (ReportController.php:978) for backward compatibility.
Adding a client
Three ways:
- From the invoice builder — start typing in the Client field, hit + Add new.
- Bulk — Users → Add New with role
Easy Invoice Client. - Programmatically via
wp_insert_user+add_role.
Required fields:
- First / last name — printed on invoices.
- Email — invoice / quote emails are sent here.
- Address — billing address on the invoice template.
Optional per-client defaults (Pro):
- Currency override.
- Tax exempt flag.
- Default payment method (if multiple are enabled).
The portal (Pro)
Pro adds a self-service area where clients log in, see every invoice, every quote, every payment, and download PDFs — without seeing wp-admin.
Unlock the portal →What the client sees
After logging in:
- Profile — name, address, default email, change password.
- Invoices — list with status badges, due dates, total + balance due.
- Quotes — list with accept / decline buttons inline.
- Payments — receipt history.
Click any row → opens the public single template, with Pay now if the invoice has a balance.
Portal pages
The Pro plugin uses three shortcodes you place anywhere:
| Shortcode | What it renders |
|---|---|
[easy_invoice_login] | Login form for the easy_invoice_client role. |
[easy_invoice_profile] | Profile + address editor. |
[easy_invoice_client_login] | Alternative login form (legacy alias). |
Recommended structure:
/client-area/login → [easy_invoice_login]
/client-area/profile → [easy_invoice_profile]
/client-area/invoices → list (auto-rendered when logged in)See Shortcodes for every attribute.
Magic link login (Pro)
Pro supports a tokenised login URL: append ?client_token=xxx to any portal page and the user is auto-logged in (single-use token, expires).
Use case: include a "View your invoice" link in the email that signs the client in without a password — see ClientPortal.php:75–78.
Client role & capabilities
The dedicated easy_invoice_client role:
- Has only
readcapability. - Cannot see wp-admin (Pro forces redirect to the portal).
- Cannot edit anything site-wide.
Combine this with a redirect on login plugin (or the Pro portal itself) so clients never land in wp-admin.
Privacy & data export (GDPR)
The Pro plugin's Privacy & Access tab adds:
- Login required to view invoice URLs.
- Token-based access (hash-protected slugs).
- GDPR exporter — exports a client's invoices/quotes/payments as JSON via WordPress's Tools → Export Personal Data.
Bulk operations
From All Clients:
- Search by name / email.
- Filter by role.
- Bulk action: Send statement of account Pro — emails a summary of outstanding invoices.
Where to go next
- 🧾 Invoices — assign invoices to clients.
- 📝 Quotes / estimates — pre-invoice flows.
- 💳 Payment gateways — let clients pay via card or PayPal.
- 💎 Pro features overview — full portal details.