Create Close leads from WooCommerce orders
A WooCommerce + Close agent flow
A first order on a WooCommerce store is the moment a stranger becomes a customer, but if your sales team works in Close, that moment is invisible to them. The order sits in WordPress; the rep who should follow up never hears about it. This recipe bridges the two. The agent queries WooCommerce orders, reads the billing details on each new one, and creates a matching lead in Close with create_lead, then attaches the buyer as a contact. WooCommerce answers the query when the agent runs it rather than notifying Close, so this fires on a cadence, and the agent tracks the highest order id it has processed so a customer who orders again isn't created as a second lead.
The flow
woocommerce/orders-queryRetrieves orders using filters like status, customer ID, and date ranges.
create_leadCreates a new lead (company).
Step by step
- Query recent orders
The agent calls woocommerce/orders-query filtered to a status like processing or completed and a recent date range. Each order carries billing name, email, company, and the line items, which is enough to build a CRM record.
- Skip the ones you've seen
Hold the last order id processed. Orders newer than that are candidates. Before creating, the agent can check Close for an existing lead with the same email so a returning buyer becomes activity on the existing record rather than a duplicate lead.
- Create the lead and contact
For a new buyer the agent calls create_lead with the company or the buyer's name, then creates a contact under it with the email and order context. The order total and items go into a note so the rep opens a record that already says what was bought.
Tell your agent
Every thirty minutes, query WooCommerce orders with status processing created since the last run, and for each buyer without an existing Close lead, create a lead and a contact with the billing name, email, and order total.
Setup
This flow needs both servers connected to your agent. Follow each install guide:
Worth knowing
- orders-query returns orders, not a deduplicated customer list, so a repeat buyer shows up again; match on billing email against Close before creating or you accumulate duplicate leads.
- Guest checkout orders may have no customer account behind them. Lean on the billing email as the identity key rather than a WooCommerce customer id, which can be absent.
Questions
- Should every order become a lead, or only the first?
- Only the first order from a given email should mint a lead. Subsequent orders from the same buyer are better logged as a note or opportunity on the existing lead, which the agent finds by searching Close on the email.
- Can it filter to orders above a value?
- Yes. The agent reads the order total from each result and can skip low-value orders, so only buyers past a threshold you set become leads worth a rep's time.