API Reference
Create Order API
The Orders endpoint allows you to programmatically submit procurement requests. Orders submitted via this endpoint are immediately reserved in the warehouse system.
Create Order
POST
/wp-json/wc/v3/orders⚡
Idempotency RecommendedWe strongly recommend sending an
Idempotency-Key header to prevent duplicate orders during network failures.Request Body (JSON)
{
"payment_method": "bacs",
"payment_method_title": "Direct Bank Transfer",
"set_paid": false,
"billing": {
"first_name": "John",
"last_name": "Doe",
"address_1": "969 Market",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US",
"email": "john.doe@example.com",
"phone": "(555) 555-5555"
},
"shipping": {
"first_name": "John",
"last_name": "Doe",
"address_1": "969 Market",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US"
},
"line_items": [
{
"product_id": 93,
"quantity": 2
},
{
"product_id": 22,
"variation_id": 23,
"quantity": 1
}
],
"shipping_lines": [
{
"method_id": "flat_rate",
"method_title": "Flat Rate",
"total": "10.00"
}
]
}Response Schema (JSON)
{
"id": 727,
"parent_id": 0,
"status": "pending",
"currency": "ZAR",
"version": "8.5.1",
"prices_include_tax": true,
"date_created": "2024-01-18T14:23:17",
"discount_total": "0.00",
"shipping_total": "10.00",
"total": "1250.00",
"customer_id": 0,
"order_key": "wc_order_58d2d042d1d",
"billing": { ... },
"shipping": { ... },
"payment_method": "bacs",
"payment_method_title": "Direct Bank Transfer",
"line_items": [ ... ],
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/orders/727"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/orders"
}
]
}
}