Create Order
Creates a new WooCommerce order with one or more line items, and optional billing/shipping, coupons, shipping cost, and fees. Tax and totals are calculated automatically from the line items.
Also known as: manual order, create an order for a customer, phone order.
| Property | Value |
|---|---|
| Ability slug | mosmcp/create-order |
| Wire tool name | mosmcp__create-order |
| Category | WooCommerce (mosmcp-woocommerce) |
| Plan | Free |
Required access
| Requirement | Value |
|---|---|
| Capability | publish_shop_orders |
| Minimum default role | Shop manager |
| Requires | WooCommerce |
| Annotations | readOnly: false · destructive: false · idempotent: false · openWorld: false |
Input schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| status | string (one of pending, processing, on-hold, completed, cancelled, refunded, failed) |
pending |
Initial order status. Defaults to pending. | |
| customer_id | integer | — | The customer (WordPress user) ID. Omit or 0 for a guest order. | |
| customer_note | string | — | Note visible to the customer. | |
| billing | object | — | ||
| billing.first_name | string | — | ||
| billing.last_name | string | — | ||
| billing.company | string | — | ||
| billing.address_1 | string | — | ||
| billing.address_2 | string | — | ||
| billing.city | string | — | ||
| billing.state | string | — | ||
| billing.postcode | string | — | ||
| billing.country | string | — | ||
| billing.email | string | — | ||
| billing.phone | string | — | ||
| shipping | object | — | ||
| shipping.first_name | string | — | ||
| shipping.last_name | string | — | ||
| shipping.company | string | — | ||
| shipping.address_1 | string | — | ||
| shipping.address_2 | string | — | ||
| shipping.city | string | — | ||
| shipping.state | string | — | ||
| shipping.postcode | string | — | ||
| shipping.country | string | — | ||
| payment_method | string | — | Payment method ID. | |
| payment_method_title | string | — | Payment method display name. | |
| transaction_id | string | — | Payment gateway transaction ID. | |
| set_paid | boolean | false |
Whether to immediately mark the order as paid. | |
| line_items | object[] | Yes | — | The products in this order (required, at least one). |
| line_items[].product_id | integer | — | The product ID. Required unless variation_id is given. | |
| line_items[].variation_id | integer | — | A specific variation ID, if this line item is a variable product variation. Takes precedence over product_id. | |
| line_items[].quantity | integer | 1 |
Quantity. Defaults to 1. | |
| shipping_lines | object[] | — | Shipping costs to add to the order. | |
| shipping_lines[].method_id | string | — | ||
| shipping_lines[].method_title | string | — | ||
| shipping_lines[].total | string | — | ||
| fee_lines | object[] | — | Additional fees to add to the order. | |
| fee_lines[].name | string | Yes | — | |
| fee_lines[].total | string | Yes | — | |
| fee_lines[].tax_class | string | — | ||
| fee_lines[].tax_status | string (one of taxable, none) |
— | ||
| coupon_lines | object[] | — | Coupon codes to apply. An invalid or expired code fails the whole request rather than being silently skipped. | |
| coupon_lines[].code | string | Yes | — |
Output schema
| Field | Type | Required |
|---|---|---|
| success | boolean | |
| message | string | |
| data | object | |
| data.id | integer | |
| data.parent_id | integer | |
| data.number | string | |
| data.order_key | string | |
| data.created_via | string | |
| data.status | string | |
| data.currency | string | |
| data.date_created | string \| null | |
| data.date_modified | string \| null | |
| data.discount_total | string | |
| data.discount_tax | string | |
| data.shipping_total | string | |
| data.shipping_tax | string | |
| data.cart_tax | string | |
| data.total | string | |
| data.total_tax | string | |
| data.prices_include_tax | boolean | |
| data.customer_id | integer | |
| data.customer_ip_address | string | |
| data.customer_user_agent | string | |
| data.customer_note | string | |
| data.billing | object | |
| data.shipping | object | |
| data.payment_method | string | |
| data.payment_method_title | string | |
| data.transaction_id | string | |
| data.date_paid | string \| null | |
| data.date_completed | string \| null | |
| data.line_items | object[] | |
| data.tax_lines | object[] | |
| data.shipping_lines | object[] | |
| data.fee_lines | object[] | |
| data.coupon_lines | object[] | |
| data.refunds | object[] | |
| meta | object | |
| meta.ability | string | |
| meta.timestamp | string | |
| meta.execution_time | string \| null |
Example
Sample prompt
Create a phone order for customer 57: two Organic Cotton T-Shirts with flat-rate shipping of $5.
Example request (json)
{
"jsonrpc": "2.0",
"id": 355,
"method": "tools/call",
"params": {
"name": "mosmcp__create-order",
"arguments": {
"input": {
"customer_id": 57,
"billing": {
"first_name": "Jane",
"last_name": "Doe",
"company": "",
"address_1": "12 High Street",
"address_2": "",
"city": "Austin",
"state": "TX",
"postcode": "78701",
"country": "US",
"email": "jane@example.com",
"phone": "+1 512 555 0142"
},
"line_items": [
{
"product_id": 42,
"quantity": 2
}
],
"shipping_lines": [
{
"method_id": "flat_rate",
"method_title": "Flat rate",
"total": "5.00"
}
]
}
}
}
}Example response (json)
{
"jsonrpc": "2.0",
"id": 355,
"result": {
"isError": false,
"structuredContent": {
"success": true,
"message": "Order created.",
"data": {
"id": 1057,
"parent_id": 0,
"number": "1057",
"order_key": "wc_order_a1B2c3D4e5",
"created_via": "mosmcp-woocommerce",
"status": "pending",
"currency": "USD",
"date_created": "2026-09-27T16:45:10",
"date_modified": "2026-09-27T16:46:02",
"discount_total": "0.00",
"discount_tax": "0.00",
"shipping_total": "5.00",
"shipping_tax": "0.00",
"cart_tax": "3.96",
"total": "56.96",
"total_tax": "3.96",
"prices_include_tax": false,
"customer_id": 57,
"customer_ip_address": "",
"customer_user_agent": "",
"customer_note": "",
"billing": {
"first_name": "Jane",
"last_name": "Doe",
"company": "",
"address_1": "12 High Street",
"address_2": "",
"city": "Austin",
"state": "TX",
"postcode": "78701",
"country": "US",
"email": "jane@example.com",
"phone": "+1 512 555 0142"
},
"shipping": {
"first_name": "Jane",
"last_name": "Doe",
"company": "",
"address_1": "12 High Street",
"address_2": "",
"city": "Austin",
"state": "TX",
"postcode": "78701",
"country": "US"
},
"payment_method": "",
"payment_method_title": "",
"transaction_id": "",
"date_paid": null,
"date_completed": null,
"line_items": [
{
"id": 311,
"name": "Organic Cotton T-Shirt",
"parent_name": null,
"product_id": 42,
"variation_id": 0,
"quantity": 2,
"tax_class": "",
"subtotal": "48.00",
"subtotal_tax": "3.96",
"total": "48.00",
"total_tax": "3.96",
"sku": "TSHIRT-ORG-01",
"price": "24.00"
}
],
"tax_lines": [
{
"id": 312,
"rate_code": "US-TX-TAX-1",
"rate_id": 1,
"label": "Tax",
"compound": false,
"tax_total": "3.96",
"shipping_tax_total": "0.00"
}
],
"shipping_lines": [
{
"id": 313,
"method_title": "Flat rate",
"method_id": "flat_rate",
"total": "5.00",
"total_tax": "0.00"
}
],
"fee_lines": [],
"coupon_lines": [],
"refunds": []
},
"meta": {
"ability": "mosmcp/create-order",
"timestamp": "2026-09-29T10:15:00+00:00",
"execution_time": "18.4ms"
}
}
}
}
Edge cases / errors
- No line_items → wcab_missing_line_items; a line item whose product/variation doesn't exist → wcab_line_item_product_not_found and the half-built order is deleted.
- An invalid or ineligible coupon in coupon_lines → wcab_invalid_coupon and the order is deleted.
- Status defaults to pending; set_paid: true marks it paid via WooCommerce's payment-complete flow (which can change status and reduce stock).
- Totals and tax are always recalculated from the items; customer_id is not checked, and omitting it creates a guest order.
| << Previous | Next >> |
|---|---|
| Create Customer | Create Order Refund |
For more information about the Secure MCP Server for WordPress plugin, explore the following resources:
Product Overview | Pricing | Try for Free | Documentation
If you have any questions regarding plugin configuration, pricing plans or licensing, please contact us or mail us at aisupport@xecurify.com.