Add or update a customer record

WooCommerceBeginner~5 minUpdated

Before you start

WooCommerce enabled, with the customer read and write abilities turned on. The customer list has no search by email or name, so the lookup means paging through the list and comparing, which is quick on a small store and slower on a big one. The create and update abilities stay off until you switch them on. This plugin's Update customer tool is high-risk, so it stays locked until High-risk abilities is unlocked in Settings, even if you ticked it in Abilities. A connection on the Shop manager preset never gets it.

Sometimes you just need one customer record right: a new wholesale buyer to set up before their first order, or a billing address a customer emailed you a correction for. Doing it in the WooCommerce admin means hunting for the account first so you do not add a second one by mistake. This does the lookup for you and shows the exact change before it saves.

The prompt
I need to add or fix a customer. First, look up whether a customer already
exists for [email or name here] and tell me what you found. The customer list
cannot be searched, so page through it and compare. Change nothing yet.
If they exist, show me the current record and the exact fields I want changed:
[for example, set the billing address to ...]. If they do not exist, show me
the new record you would create from [email, name, and address here].
Once I approve it, save the change: update only the fields I confirmed, or
create the one new record. Then read the saved customer back to me so I can
check it landed right.

Why this is safe to run

The lookup runs first and writes nothing, so you always know whether you are editing an existing customer or adding a new one before anything saves. That single read is what keeps this from quietly creating a duplicate.

The write is scoped tight. An update changes only the fields you approved and leaves the rest of the record alone; a create adds exactly the one customer you confirmed. It never touches orders, coupons, or products, and it cannot email the customer or reset a password. Every write is checked against the capability of the user you bound the agent to and recorded in the Activity Log, and reading the saved record back to you is the last step so you can catch a typo on the spot.

Already connected? Skip the paste. Ask your agent for the “add or update a customer record” recipe, or just tell it the customer and the change, and it runs the same lookup-first flow on your own store.

How it works

  1. Page through the customer list to check whether the customer already exists, so you do not create a duplicate.
  2. Show exactly what will be created or which fields will change, and wait for your approval.
  3. Create the new customer, or update only the fields you approved on the existing one.
  4. Return the saved record so you can confirm it reads correctly.

Questions

How does it avoid creating a duplicate customer?
It pages through the customer list and compares emails and names first. If a record already matches, it updates that one instead of adding a second, and it shows you which it found before changing anything.
Is an update reversible if I get a field wrong?
An edit can be set back by running the recipe again. Take more care with the email field, since a change there can affect where the customer's account emails go. Take a little more care creating a brand-new record, since the lookup-first step is there exactly to stop an accidental duplicate.