Your own AI
Use Claude, ChatGPT, Codex or another AI app with B2B: what it can read and prepare, how to connect it, approving and undoing its changes, the AI activity log, the switches, the chat in B2B's screens and the shopping assistant for business customers.
What it is for
B2B works with the AI you already use. Claude, ChatGPT, Codex and other AI apps can read your B2B setup and records, answer questions about them and prepare changes. A chat in B2B's own screens does the same with your own AI company, and an optional shopping assistant answers signed-in business customers about their own prices.
A change an AI prepares is saved only after you approve it in WordPress, with the exact values in front of you, and most saved changes can be undone from the AI log. B2B adds no AI service and no charge of its own: the AI app or AI company you choose bills you directly. Everything is in B2B's AI tab.
What the AI can read and prepare
B2B registers its AI tools with WordPress's own Abilities API (WordPress 6.9 or later), so every AI tool that uses it can work with B2B: WordPress's MCP Adapter, WooCommerce MCP, connector plugins such as WPVibe or StoreAgent, and WordPress 7's AI features.
| The AI can | Using |
|---|---|
| Find a record by name, email, SKU or ID | Find B2B records |
| Read settings and records as they are saved | Inspect B2B settings or a record, Read a page of B2B records |
| Calculate the price an approved account pays for a product and quantity | Calculate a business customer's price |
| List business customers with status, group, last order date, paid orders and lifetime spend | List business customers |
| Read the business sales report for any dates | B2B sales report for any dates |
| Check diagnostics, preview saved emails, open private documents | B2B diagnostics, Preview a saved B2B email, Link to a private B2B document |
| Read the license status (never the key) | B2B license status |
| Read the AI log and the changes waiting for you | B2B AI activity |
| Prepare any of B2B's 70 reviewed changes for your approval | List the B2B changes an AI can prepare, Describe one B2B change, Prepare a B2B change for the owner's approval, Status of a prepared B2B change |
| Give you the steps to make a change yourself | Show how to make a B2B change by hand |
The 70 changes cover business defaults and the store mode (mixed, business only or catalog), the order form, business groups, accounts (status, group, terms and private notes), exact product prices, catalog and quantity rules, account, group and default terms, order limits, price books with their rules, quantity bands, cart discounts, coupons, display, import and restore, customer-role prices, applications and their questions, customer roles, page access, quotes and quote setup, tax exemptions, company teams and purchasing, agency licensing, notification settings and tests, the workspace, license checks and safe removal. Before it prepares a change, the AI finds the exact record and reads its current values.
A signed-in customer's own AI, and the shopping assistant, can use three more: My business account (their account, group and company role), My business prices (their own price per unit for products they may see and buy) and My quotes. They show only that customer's own data.
Connect Claude Desktop, Claude Code or Codex
- Make WordPress's MCP Adapter available: in WooCommerce, open Settings → Advanced → Features and switch on WooCommerce MCP, or install WordPress's MCP Adapter plugin. The AI tab's MCP line says Ready once it runs. Not started means the adapter is there (WooCommerce 11.2 and later include it) but WooCommerce MCP is still off and no MCP Adapter plugin starts it.
- Create an application password for the WordPress user the AI should act as (a Shop manager is enough) under Users → Profile → Application Passwords. Name it after the AI app, for example "Claude Desktop": the AI log shows that name.
- In the AI tab, under Connect Claude, Claude Code or Codex, copy the setup for your app, replace APPLICATION PASSWORD with the password (and the user name if the AI uses another user), and add it as the tab says: Claude Desktop under Settings → Developer → Edit Config, Claude Code and Codex with the command in a terminal. The setup runs WordPress's MCP bridge through npx, so the computer needs Node.js.
B2B's MCP address is your site address followed by /wp-json/affstackdev-b2b/mcp; it lists only B2B's tools. claude.ai and ChatGPT on the web sign in to a store through a connector plugin that adds their sign-in (WPVibe or StoreAgent, which need an account with their maker) or through AffStackDev AI; B2B's tools appear there by themselves.
Approve or reject a change
A change an AI prepares appears under Changes waiting for your approval in the AI tab, and as a card in the chat when the chat prepared it. Open it: B2B prepares it again from what is saved now and shows each value under Now and After approval, what else happens (for example an email to the customer), and whether you can undo it afterwards. If B2B changed after the AI prepared it, a note says so; the values shown are the current ones.
- Approve and save saves exactly the values on the screen, once, through B2B's normal checks. If anything changed after you opened the page, nothing is saved; open the change again to see the new values.
- Reject discards it.
- A change that waits longer than 7 days expires.
If B2B could not confirm whether an approved change was saved (for example because the database connection dropped), the change shows as uncertain and B2B holds further AI changes until it is cleared. Open it and choose Check what happened: B2B reads its own record of the operation and either marks the change saved or, when it was not saved, marks it not saved and allows AI changes again.
Undo a change
A saved change that changed settings or records has Undo in the AI log. Undo shows each value it writes back under Now and After undo and restores only the values that change set. If someone changed those values afterwards, undo is refused so it never overwrites newer work; change them on their screen instead. Undo can also remove an exact price or catalog rule the AI created, and add back one the AI removed (with a new ID).
The log says when a change cannot be undone and why:
- a new business group or price book stays (edit or unpublish it on its screen);
- a change that emailed, offered or sent something (quotes, tax decisions, invitations, test emails, an account status change) cannot be taken back;
- license, agency and removal changes have their own steps;
- a published page and customer roles are changed in Pages and in Applications.
The AI activity log
The AI activity log in the AI tab lists everything an AI did with B2B in the last 90 days: every read, prepared change, approval, rejection, saved change, undo and chat message. Each entry has the time (UTC), who, how it connected (MCP, WordPress abilities, the B2B chat, the shopping assistant, AffStackDev AI or WP-CLI) with the application password's name, the result, and the AI model for B2B's chats. Filter it by kind of entry and by connection. Changes waiting for you link to their review; saved changes that can be undone have Undo.
Choose what AI may do
Under What AI may do in the AI tab:
| Switch | Effect |
|---|---|
| AI may use B2B | Off pauses every AI route at once: MCP, WordPress abilities, both chats and AffStackDev AI's B2B actions. |
| Read-only | AI can read B2B but cannot prepare changes. |
| Outside AI apps may use B2B | Claude, ChatGPT, Codex and other apps through MCP or WordPress abilities, WP-CLI and AffStackDev AI. Off leaves only B2B's own chats. |
| Outside AI apps may prepare changes | Off: outside apps may only read, and changes can still be prepared in B2B's own chat. |
| Changes AI may prepare for your approval | One switch for each group: store setup; accounts and groups; prices and discounts; applications and access; quotes; tax exemptions; company purchasing; agency licensing; license and removal. A group that is off cannot be prepared, and the AI is told why. |
| Chat in B2B's screens, Chat button | The chat, on every B2B screen or only on the AI tab. |
| AI company for the chats | Automatic, or one of the AI companies set up in Settings → Connectors. |
| Shopping assistant for business customers, most messages per day | The assistant for signed-in business customers and the store's daily limit for it. |
A new installation starts with AI on for B2B's chats and outside apps, changes prepared for your approval in every group, the chat on and the shopping assistant off. A developer can pause AI, or make it read-only, for a site in wp-config.php with define( 'AFSD_B2B_AI_DISABLED', true ); or define( 'AFSD_B2B_AI_READ_ONLY', true );; the AI tab then says so.
Chat in B2B's screens
The chat needs WordPress 7.0 or later and one AI company set up in Settings → Connectors (Anthropic, Google or OpenAI: its provider plugin and your own API key). B2B uses that key; your AI company bills each message. The AI tab says what is missing.
- Open B2B AI chat at the bottom of a B2B screen.
- Choose the answer mode: Prepare changes for my approval, or Show me how (change nothing) for the steps to make the change yourself.
- A prepared change appears under the answer as a card with each value under Now and After. Approve and save saves it, Reject discards it, and Open in B2B > AI opens its full review.
The chat can only use B2B's own tools, and every message and the model that answered are in the AI log. It remembers your last eight questions and its answers for two hours; New conversation starts again.
Shopping assistant for business customers
When you switch it on, signed-in customers of approved business accounts see Ask about your prices on the shop, product, cart and account pages. It finds products they may order and gives their own business price per unit for a quantity (before tax, coupons and cart discounts), their account and their quotes. It uses your AI company from Settings → Connectors, answers at most 30 messages per customer per hour and stops for the day at your daily limit.
With AffStackDev AI
When AffStackDev AI is installed, its claude.ai and ChatGPT sign-in and its review workspace use the same 79 B2B actions as before. Their B2B reads and changes also appear in B2B's AI log and follow the switches in B2B's AI tab, and a change saved there can be undone from B2B's log in the same way.
Related pages
| Page | What it covers |
|---|---|
| Getting started | Install, license and the first business group. |
| Business prices | The prices the AI calculates and changes. |
| Tax exemptions, reports and records | The sales report and diagnostics the AI reads. |