Connectors

/

WooCommerce

/

Create a WooCommerce order for a customer
Write

Place a WooCommerce order for a customer, right first time

For sales and support teams who want to place a phone or email order in WooCommerce by asking their AI assistant, with stock checked.

Try PopdockAI free
Get a live demo
Create a WooCommerce order for a customer
Create a WooCommerce order for dana@northwindtraders.com: MUG-BLU x 4 and TEE-BLK-L x 2.
Dana Whitfield is an existing customer, and both items are in stock. - Line: MUG-BLU Blue mug x 4 at 12.00, 48.00 - Line: TEE-BLK-L Black tee, large x 2 at 25.00, 50.00 - Subtotal: 98.00, not marked paid - Invoice: not sent Shall I create the order?
WooCommerce
Sample figures. Your results come from your own account.
woocommerce-get-customer
woocommerce-add-customer
woocommerce-get-product
woocommerce-get-product-variation
woocommerce-add-order
woocommerce-send-order-details
woocommerce-get-order-line

On this page

The problem

The problem

The prompt

Who it's for

How it works

Tools used

Connector

WooCommerce

WooCommerce
Run it on your own WooCommerce data.

Connect WooCommerce, pick your AI tool and paste the prompt.

Try PopdockAI free

The problem

Phone orders that go wrong on the second try

Placing a WooCommerce order for a customer who called means finding them, matching each SKU to the right product or variation and checking stock before promising anything. A failed attempt retried carelessly gives the customer two orders.

Without PopdockAI

  • Search for the customer in WooCommerce
  • Find each SKU among products and variations
  • Check stock before promising a date
  • Retry after an error and create a duplicate

With PopdockAI

  • The customer is found, or you choose to create them or use a guest order
  • Each SKU is matched to a product or variation with stock checked
  • You see lines, prices and paid status before anything is created
  • The order is created once, read back and checked before any retry

The prompt

Use this prompt

Copy it into any AI tool connected to PopdockAI. Swap the values in braces for your own.

Prompt
**Objective:** Create a WooCommerce order for the customer `{customer-email}` containing `{items}` (up to three lines, each a SKU and a quantity), mark it paid only if `{set-paid}` is true (default false), and email the invoice only if `{send-invoice}` is true (default false).

**Step 1: Find the customer**

Call `woocommerce-get-customer` with `email` = `{customer-email}`. Keep `customer-id`, `first-name` and `last-name`.

If there is no match, ask the user whether to (a) create the customer with `woocommerce-add-customer`, giving at least `email` and the name, or (b) place a guest order. Do nothing until they choose.

**Step 2: Resolve every line**

Parse `{items}` into SKU and quantity pairs. More than three lines: stop, since the tool takes three. For each SKU:

1. `woocommerce-get-product` with `sku`. A `simple` product: use its product id.
2. No match: `woocommerce-get-product-variation` with `sku`. A match: use `product-variation-id`, as the order tool expects the variation's id.
3. A `variable` parent: list its variations with `woocommerce-get-product-variation` (`product-id`) and stop so the user can choose.
4. Not found, `outofstock`, or `stock-quantity` below the quantity requested: report it and stop.

**Step 3: Confirm**

Show: customer (or "guest"), each line with name, SKU, quantity, unit `price` and line amount, the estimated subtotal before tax and shipping, status `pending` unless paid, whether it is marked paid, and whether the invoice will be emailed. Say that marking it paid moves it to `processing` and reduces stock. Wait for an explicit yes.

**Step 4: Create**

If the user chose (a) in Step 1, call `woocommerce-add-customer` once and use the returned `id`.

Call `woocommerce-add-order` once with `customer-id` (empty for a guest), `billing-email` = `{customer-email}`, `billing-first-name`, `billing-last-name`, `line1-product-id` and `line1-quantity` (and lines 2 and 3 where given), and `set-paid` = true only when `{set-paid}` is true.

If `{send-invoice}` is true, call `woocommerce-send-order-details` once with the new order's `id`.

**Step 5: Verify and report**

Call `woocommerce-get-order-line` with `order-id` = the new id. Report the order number, status, total and currency, the lines as stored, and whether the invoice was sent.

**Rules & Guidelines:**

* The only write tools this prompt may call are `woocommerce-add-customer` (once, only if the user chose it), `woocommerce-add-order` (once) and `woocommerce-send-order-details` (once, only if asked).
* Do not call any other write tool (`woocommerce-update-order`, `woocommerce-add-order-note`, `woocommerce-add-refund`, `woocommerce-update-customer`, `woocommerce-add-product`, `woocommerce-update-product`, `woocommerce-update-product-variation`, `woocommerce-add-coupon`, `woocommerce-update-coupon`).
* Never retry `woocommerce-add-order` after an error without checking with `woocommerce-get-order` (`customer-email`, today's `created-date.from`) that no order was created, or the customer gets a duplicate.

**Validation:**

* If `{items}` cannot be read as SKU and quantity pairs, ask for it in the form "SKU x quantity, SKU x quantity" and stop.
* Quantities must be whole numbers of 1 or more.
* If `{set-paid}` or `{send-invoice}` is empty, treat it as false.
* If the user's confirmation is anything other than a clear yes, stop without writing.

Who it's for

One answer, three teams that use it

Sales reps

Take an order over the phone

Place an order for a customer while they are on the call, with stock checked before you promise anything.

Create a WooCommerce order for priya@contoso.com: CAP-RED x 10 and BAG-GRY x 5, and send the invoice.

Customer service agents

Replace an order without duplicates

Orders are created once and checked after any error, so the customer never gets two.

Place a WooCommerce order for tom@fabrikam.com with MUG-WHT x 6 as a paid order.

Wholesale coordinators

Handle emailed orders quickly

Turn an emailed order into a WooCommerce order with the right variations, without searching the catalog.

Order TEE-NVY-M x 12 and TEE-NVY-L x 8 in WooCommerce for orders@northwindtraders.com.

How it works

What PopdockAI does when you ask

You give the customer email and the SKUs, and your AI assistant builds the order and checks stock. Nothing is created until you confirm, and a failure is checked before any retry.

01

Ask

You give the customer email and up to three SKUs with quantities.

Your AI tool

02

Check

It finds the customer and matches each SKU to a product or variation with stock.

woocommerce-get-customer
woocommerce-get-product
woocommerce-get-product-variation

03

Confirm

You see lines, prices, subtotal, paid status and invoice choice.

No items found.

04

Create

It creates the order once and reads the stored lines back.

Your AI tool

What PopdockAI provides

The tools behind the answer

Ready made tools for WooCommerce and one secure connection to your AI tool. No code, no exports.

get-data

woocommerce-get-customer

Returns WooCommerce customer accounts with name, billing address, role and whether they have paid for an order. Filter by email, id, last name, billing country or state, role and created date range.
run-action

woocommerce-add-customer

Creates a WooCommerce customer account from an email address, with optional name, username, company, phone and billing address.
get-data

woocommerce-get-product

Returns WooCommerce products with prices, stock, status, categories, total sales and average rating. Filter by SKU, name, category, type, status, stock status, price range or a low stock threshold.
get-data

woocommerce-get-product-variation

Returns the variations of WooCommerce variable products with SKU, prices, sale flag and stock. Filter by parent product, SKU, status, stock status, price range, on sale or a low stock threshold.
run-action

woocommerce-add-order

Creates a WooCommerce order with up to three product lines, for a registered customer or a guest, with billing name and email, payment method, status and an option to mark it paid.
run-action

woocommerce-send-order-details

Emails the order details (invoice) of a WooCommerce order to the order's billing email address.
get-data

woocommerce-get-order-line

Returns the product lines on WooCommerce orders: product, SKU, quantity, price, line total and tax. Filter by order, customer, SKU or product id, order status and date range.
Read only.Nothing in WooCommerce Changes

This report is built from Get data tools only. PopdockAI applies the row, field and parameter rules your admin sets, and every query is written to the audit trail.

How Popdock AI secures your data

The outcome

Orders placed right the first time

Try PopdockAI free
Get a live demo

Related use cases

More ways to put this data to work

All Ramp use cases

One prompt template with infinite possibilities.

‍

Your AI assistant adapts its approach, tone, and capabilities to match each unique context while you maintain a single, manageable workflow.

Join forward-thinking companies that are transforming their operations with intelligent, secure AI automation.

Try PopdockAI Free
See Documentation