Orders API
The Orders endpoint allows you to create, read, update, and delete orders in your WooCommerce store.The Order Object
Order Properties
integer
required
Unique identifier for the order. Read-only.
integer
default:"0"
Parent order ID.
string
Order number. Read-only.
string
Order key. Read-only.
string
How the order was created:
checkout, rest-api, adminstring
default:"pending"
Order status. Options:
pending, processing, on-hold, completed, cancelled, refunded, failed, trashstring
Currency the order was created with, in ISO 4217 format.
string
The date the order was created, in ISO8601 format. Read-only.
string
The date the order was last modified, in ISO8601 format. Read-only.
string
Total discount amount for the order. Read-only.
string
Total discount tax amount for the order. Read-only.
string
Total shipping amount for the order. Read-only.
string
Total shipping tax amount for the order. Read-only.
string
Sum of line item taxes only. Read-only.
string
Grand total. Read-only.
string
Sum of all taxes. Read-only.
integer
default:"0"
User ID who owns the order. 0 for guests.
object
Billing address.
object
Shipping address.
string
Payment method ID.
string
Payment method title.
string
Unique transaction ID from payment gateway.
array
Line items data.
List All Orders
Retrieve a list of all orders in your store.Query Parameters
integer
default:"1"
Current page of the collection.
integer
default:"10"
Maximum number of items to return (max 100).
string
Limit results to those matching a string.
string
Limit response to orders published after a given ISO8601 date.
string
Limit response to orders published before a given ISO8601 date.
string
default:"any"
Limit result set to orders with specific status. Options:
any, pending, processing, on-hold, completed, cancelled, refunded, failed, trashinteger
Limit result set to orders assigned to a specific customer (ID).
integer
Limit result set to orders that include a specific product (ID).
string
default:"date"
Sort collection by attribute. Options:
date, id, title, slugstring
default:"desc"
Order sort direction. Options:
asc, descExample Response
Retrieve an Order
Get details of a single order by ID.Create an Order
Create a new order in your store.Required Fields
While no fields are strictly required, you should typically include billing information and at least one line item.
Important Fields
object
Billing address object (see Order Object above)
object
Shipping address object (see Order Object above)
array
Array of line item objects
array
Array of shipping line objects
array
Array of coupon line objects
integer
User ID. Set to 0 for guest checkout.
string
default:"pending"
Order status:
pending, processing, on-hold, completed, cancelled, refunded, failedboolean
default:"false"
Set to true to mark order as paid.
Update an Order
Update an existing order.Delete an Order
Delete an order permanently or move it to trash.Batch Update Orders
Create, update, and delete multiple orders in a single request.Order Notes
Manage notes attached to orders.List Order Notes
Create Order Note
Common Use Cases
Get Orders by Status
Get Customer’s Orders
Get Orders by Date Range
Mark Order as Completed
Add Tracking Information
Error Handling
Invalid Order ID
Invalid Product in Line Item
Insufficient Stock
Next Steps
Products API
Manage store products
Customers API
Work with customer data