The orders API allows you to create, view, update, and delete individual, or a batch, of orders.
Attribute | Type | Description |
---|---|---|
id |
integer | Unique identifier for the resource. read-only |
parent_id |
integer | Parent order ID. |
status |
string | Order status. Default is pending . Options (plugins may include new status): pending , processing , on-hold , completed , cancelled , refunded and failed . |
order_key |
string | Order key. read-only |
number |
string | Order number. read-only |
currency |
string | Currency the order was created with, in ISO format, e.g USD . Default is the current store currency. |
version |
string | Version of WooCommerce when the order was made. read-only |
prices_include_tax |
boolean | Shows if the prices included tax during checkout. read-only |
date_created |
date-time | The date the order was created, in the site's timezone. read-only |
date_modified |
date-time | The date the order was last modified, in the site's timezone. read-only |
customer_id |
integer | User ID who owns the order. Use 0 for guests. Default is 0 . |
discount_total |
string | Total discount amount for the order. read-only |
discount_tax |
string | Total discount tax amount for the order. read-only |
shipping_total |
string | Total shipping amount for the order. read-only |
shipping_tax |
string | Total shipping tax amount for the order. read-only |
cart_tax |
string | Sum of line item taxes only. read-only |
total |
string | Grand total. read-only |
total_tax |
string | Sum of all taxes. read-only |
billing |
array | Billing address. See Customer Billing Address properties. |
shipping |
array | Shipping address. See Customer Shipping Address properties. |
payment_method |
string | Payment method ID. |
payment_method_title |
string | Payment method title. |
set_paid |
boolean | Define if the order is paid. It will set the status to processing and reduce stock items. Default is false . write-only |
transaction_id |
string | Unique transaction ID. In write-mode only is available if set_paid is true . |
customer_ip_address |
string | Customer's IP address. read-only |
customer_user_agent |
string | User agent of the customer. read-only |
created_via |
string | Shows where the order was created. read-only |
customer_note |
string | Note left by customer during checkout. |
date_completed |
date-time | The date the order was completed, in the site's timezone. read-only |
date_paid |
date-time | The date the order has been paid, in the site's timezone. read-only |
cart_hash |
string | MD5 hash of cart items to ensure orders are not modified. read-only |
line_items |
array | Line items data. See Line Items properties. |
tax_lines |
array | Tax lines data. See Tax Lines properties. read-only |
shipping_lines |
array | Shipping lines data. See Shipping Lines properties. |
fee_lines |
array | Fee lines data. See Fee Lines Properties. |
coupon_lines |
array | Coupons line data. See Coupon Lines properties. |
Attribute | Type | Description |
---|---|---|
id |
integer | Item ID. read-only |
name |
string | Product name. read-only |
sku |
string | Product SKU. read-only |
product_id |
integer | Product ID. |
variation_id |
integer | Variation ID, if applicable. |
quantity |
integer | Quantity ordered. |
tax_class |
string | Tax class of product. read-only |
price |
string | Product price. read-only |
subtotal |
string | Line subtotal (before discounts). |
subtotal_tax |
string | Line subtotal tax (before discounts). |
total |
string | Line total (after discounts). |
total_tax |
string | Line total tax (after discounts). |
taxes |
array | Line taxes with id , total and subtotal . read-only |
meta |
array | Line item meta data with key , label and value . read-only |
Attribute | Type | Description |
---|---|---|
id |
integer | Item ID. read-only |
rate_code |
string | Tax rate code. read-only |
rate_id |
string | Tax rate ID. read-only |
label |
string | Tax rate label. read-only |
compound |
boolean | Show if is a compound tax rate. Compound tax rates are applied on top of other tax rates. read-only |
tax_total |
string | Tax total (not including shipping taxes). read-only |
shipping_tax_total |
string | Shipping tax total. read-only |
Attribute | Type | Description |
---|---|---|
id |
integer | Item ID. read-only |
method_title |
string | Shipping method name. |
method_id |
string | Shipping method ID. required |
total |
string | Line total (after discounts). |
total_tax |
string | Line total tax (after discounts). read-only |
taxes |
array | Line taxes with id and total . read-only |
Attribute | Type | Description |
---|---|---|
id |
integer | Item ID. read-only |
name |
string | Fee name. required |
tax_class |
string | Tax class. required if the fee is taxable |
tax_status |
string | Tax status of fee. Set to taxable if need apply taxes. |
total |
string | Line total (after discounts). |
total_tax |
string | Line total tax (after discounts). |
taxes |
array | Line taxes with id , total and subtotal . read-only |
Attribute | Type | Description |
---|---|---|
id |
integer | Item ID. read-only |
code |
string | Coupon code. required |
discount |
string | Discount total. required |
discount_tax |
string | Discount total tax. read-only |
This API helps you to create a new order.
Example of create a paid order:
curl -X POST https://example.com/wp-json/wc/v1/orders \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"payment_method": "bacs",
"payment_method_title": "Direct Bank Transfer",
"set_paid": true,
"billing": {
"first_name": "John",
"last_name": "Doe",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US",
"email": "[email protected]",
"phone": "(555) 555-5555"
},
"shipping": {
"first_name": "John",
"last_name": "Doe",
"address_1": "969 Market",
"address_2": "",
"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
}
]
}'
var data = {
payment_method: 'bacs',
payment_method_title: 'Direct Bank Transfer',
set_paid: true,
billing: {
first_name: 'John',
last_name: 'Doe',
address_1: '969 Market',
address_2: '',
city: 'San Francisco',
state: 'CA',
postcode: '94103',
country: 'US',
email: '[email protected]',
phone: '(555) 555-5555'
},
shipping: {
first_name: 'John',
last_name: 'Doe',
address_1: '969 Market',
address_2: '',
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
}
]
};
WooCommerce.post('orders', data, function(err, data, res) {
console.log(res);
});
<?php
$data = [
'payment_method' => 'bacs',
'payment_method_title' => 'Direct Bank Transfer',
'set_paid' => true,
'billing' => [
'first_name' => 'John',
'last_name' => 'Doe',
'address_1' => '969 Market',
'address_2' => '',
'city' => 'San Francisco',
'state' => 'CA',
'postcode' => '94103',
'country' => 'US',
'email' => '[email protected]',
'phone' => '(555) 555-5555'
],
'shipping' => [
'first_name' => 'John',
'last_name' => 'Doe',
'address_1' => '969 Market',
'address_2' => '',
'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
]
]
];
print_r($woocommerce->post('orders', $data));
?>
data = {
"payment_method": "bacs",
"payment_method_title": "Direct Bank Transfer",
"set_paid": True,
"billing": {
"first_name": "John",
"last_name": "Doe",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US",
"email": "[email protected]",
"phone": "(555) 555-5555"
},
"shipping": {
"first_name": "John",
"last_name": "Doe",
"address_1": "969 Market",
"address_2": "",
"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
}
]
}
print(wcapi.post("orders", data).json())
data = {
payment_method: "bacs",
payment_method_title: "Direct Bank Transfer",
set_paid: true,
billing: {
first_name: "John",
last_name: "Doe",
address_1: "969 Market",
address_2: "",
city: "San Francisco",
state: "CA",
postcode: "94103",
country: "US",
email: "[email protected]",
phone: "(555) 555-5555"
},
shipping: {
first_name: "John",
last_name: "Doe",
address_1: "969 Market",
address_2: "",
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
}
]
}
woocommerce.post("orders", data).parsed_response
JSON response example:
{
"id": 154,
"parent_id": 0,
"status": "processing",
"order_key": "wc_order_574cc02467274",
"number": "154",
"currency": "USD",
"version": "2.6.0",
"prices_include_tax": false,
"date_created": "2016-05-30T22:35:16",
"date_modified": "2016-05-30T22:35:16",
"customer_id": 0,
"discount_total": "0.00",
"discount_tax": "0.00",
"shipping_total": "10.00",
"shipping_tax": "0.00",
"cart_tax": "1.95",
"total": "37.95",
"total_tax": "1.95",
"billing": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US",
"email": "[email protected]",
"phone": "(555) 555-5555"
},
"shipping": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US"
},
"payment_method": "bacs",
"payment_method_title": "bacs",
"transaction_id": "",
"customer_ip_address": "127.0.0.1",
"customer_user_agent": "curl/7.47.0",
"created_via": "rest-api",
"customer_note": "",
"date_completed": "2016-05-30T19:35:16",
"date_paid": "2016-05-30 19:35:25",
"cart_hash": "",
"line_items": [
{
"id": 18,
"name": "Woo Single #1",
"sku": "",
"product_id": 93,
"variation_id": 0,
"quantity": 2,
"tax_class": "",
"price": "3.00",
"subtotal": "6.00",
"subtotal_tax": "0.45",
"total": "6.00",
"total_tax": "0.45",
"taxes": [
{
"id": 75,
"total": 0.45,
"subtotal": 0.45
}
],
"meta": []
},
{
"id": 19,
"name": "Ship Your Idea",
"sku": "",
"product_id": 22,
"variation_id": 23,
"quantity": 1,
"tax_class": "",
"price": "20.00",
"subtotal": "20.00",
"subtotal_tax": "1.50",
"total": "20.00",
"total_tax": "1.50",
"taxes": [
{
"id": 75,
"total": 1.5,
"subtotal": 1.5
}
],
"meta": [
{
"key": "pa_color",
"label": "Color",
"value": "Black"
}
]
}
],
"tax_lines": [
{
"id": 21,
"rate_code": "US-CA-STATE TAX",
"rate_id": "75",
"label": "State Tax",
"compound": false,
"tax_total": "1.95",
"shipping_tax_total": "0.00"
}
],
"shipping_lines": [
{
"id": 20,
"method_title": "Flat Rate",
"method_id": "flat_rate",
"total": "10.00",
"total_tax": "0.00",
"taxes": []
}
],
"fee_lines": [],
"coupon_lines": [],
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v1/orders/154"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v1/orders"
}
]
}
}
This API lets you retrieve and view a specific order.
curl https://example.com/wp-json/wc/v1/orders/154 \
-u consumer_key:consumer_secret
WooCommerce.get('orders/154', function(err, data, res) {
console.log(res);
});
<?php print_r($woocommerce->get('orders/154')); ?>
print(wcapi.get("orders/154").json())
woocommerce.get("orders/154").parsed_response
JSON response example:
{
"id": 154,
"parent_id": 0,
"status": "processing",
"order_key": "wc_order_574cc02467274",
"number": "154",
"currency": "USD",
"version": "2.6.0",
"prices_include_tax": false,
"date_created": "2016-05-30T22:35:16",
"date_modified": "2016-05-30T22:35:16",
"customer_id": 0,
"discount_total": "0.00",
"discount_tax": "0.00",
"shipping_total": "10.00",
"shipping_tax": "0.00",
"cart_tax": "1.95",
"total": "37.95",
"total_tax": "1.95",
"billing": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US",
"email": "[email protected]",
"phone": "(555) 555-5555"
},
"shipping": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US"
},
"payment_method": "bacs",
"payment_method_title": "bacs",
"transaction_id": "",
"customer_ip_address": "127.0.0.1",
"customer_user_agent": "curl/7.47.0",
"created_via": "rest-api",
"customer_note": "",
"date_completed": "2016-05-30T19:35:16",
"date_paid": "2016-05-30 19:35:25",
"cart_hash": "",
"line_items": [
{
"id": 18,
"name": "Woo Single #1",
"sku": "",
"product_id": 93,
"variation_id": 0,
"quantity": 2,
"tax_class": "",
"price": "3.00",
"subtotal": "6.00",
"subtotal_tax": "0.45",
"total": "6.00",
"total_tax": "0.45",
"taxes": [
{
"id": 75,
"total": 0.45,
"subtotal": 0.45
}
],
"meta": []
},
{
"id": 19,
"name": "Ship Your Idea",
"sku": "",
"product_id": 22,
"variation_id": 23,
"quantity": 1,
"tax_class": "",
"price": "20.00",
"subtotal": "20.00",
"subtotal_tax": "1.50",
"total": "20.00",
"total_tax": "1.50",
"taxes": [
{
"id": 75,
"total": 1.5,
"subtotal": 1.5
}
],
"meta": [
{
"key": "pa_color",
"label": "Color",
"value": "Black"
}
]
}
],
"tax_lines": [
{
"id": 21,
"rate_code": "US-CA-STATE TAX",
"rate_id": "75",
"label": "State Tax",
"compound": false,
"tax_total": "1.95",
"shipping_tax_total": "0.00"
}
],
"shipping_lines": [
{
"id": 20,
"method_title": "Flat Rate",
"method_id": "flat_rate",
"total": "10.00",
"total_tax": "0.00",
"taxes": []
}
],
"fee_lines": [],
"coupon_lines": [],
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v1/orders/154"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v1/orders"
}
]
}
}
Parameter | Type | Description |
---|---|---|
dp |
string | Number of decimal points to use in each resource. |
This API helps you to view all the orders.
curl https://example.com/wp-json/wc/v1/orders \
-u consumer_key:consumer_secret
WooCommerce.get('orders', function(err, data, res) {
console.log(res);
});
<?php print_r($woocommerce->get('orders')); ?>
print(wcapi.get("orders").json())
woocommerce.get("orders").parsed_response
JSON response example:
[
{
"id": 154,
"parent_id": 0,
"status": "processing",
"order_key": "wc_order_574cc02467274",
"number": "154",
"currency": "USD",
"version": "2.6.0",
"prices_include_tax": false,
"date_created": "2016-05-30T22:35:16",
"date_modified": "2016-05-30T22:35:16",
"customer_id": 0,
"discount_total": "0.00",
"discount_tax": "0.00",
"shipping_total": "10.00",
"shipping_tax": "0.00",
"cart_tax": "1.95",
"total": "37.95",
"total_tax": "1.95",
"billing": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US",
"email": "[email protected]",
"phone": "(555) 555-5555"
},
"shipping": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US"
},
"payment_method": "bacs",
"payment_method_title": "bacs",
"transaction_id": "",
"customer_ip_address": "127.0.0.1",
"customer_user_agent": "curl/7.47.0",
"created_via": "rest-api",
"customer_note": "",
"date_completed": "2016-05-30T19:35:16",
"date_paid": "2016-05-30 19:35:25",
"cart_hash": "",
"line_items": [
{
"id": 18,
"name": "Woo Single #1",
"sku": "",
"product_id": 93,
"variation_id": 0,
"quantity": 2,
"tax_class": "",
"price": "3.00",
"subtotal": "6.00",
"subtotal_tax": "0.45",
"total": "6.00",
"total_tax": "0.45",
"taxes": [
{
"id": 75,
"total": 0.45,
"subtotal": 0.45
}
],
"meta": []
},
{
"id": 19,
"name": "Ship Your Idea",
"sku": "",
"product_id": 22,
"variation_id": 23,
"quantity": 1,
"tax_class": "",
"price": "20.00",
"subtotal": "20.00",
"subtotal_tax": "1.50",
"total": "20.00",
"total_tax": "1.50",
"taxes": [
{
"id": 75,
"total": 1.5,
"subtotal": 1.5
}
],
"meta": [
{
"key": "pa_color",
"label": "Color",
"value": "Black"
}
]
}
],
"tax_lines": [
{
"id": 21,
"rate_code": "US-CA-STATE TAX",
"rate_id": "75",
"label": "State Tax",
"compound": false,
"tax_total": "1.95",
"shipping_tax_total": "0.00"
}
],
"shipping_lines": [
{
"id": 20,
"method_title": "Flat Rate",
"method_id": "flat_rate",
"total": "10.00",
"total_tax": "0.00",
"taxes": []
}
],
"fee_lines": [],
"coupon_lines": [],
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v1/orders/154"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v1/orders"
}
]
}
},
{
"id": 116,
"parent_id": 0,
"status": "processing",
"order_key": "wc_order_5728e6e53d2a4",
"number": "116",
"currency": "USD",
"version": "2.6.0",
"prices_include_tax": false,
"date_created": "2016-05-03T17:59:00",
"date_modified": "2016-05-30T22:37:31",
"customer_id": 1,
"discount_total": "0.00",
"discount_tax": "0.00",
"shipping_total": "10.00",
"shipping_tax": "0.00",
"cart_tax": "0.00",
"total": "14.00",
"total_tax": "0.00",
"billing": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US",
"email": "[email protected]",
"phone": "(555) 555-5555"
},
"shipping": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US"
},
"payment_method": "bacs",
"payment_method_title": "Direct Bank Transfer",
"transaction_id": "",
"customer_ip_address": "127.0.0.1",
"customer_user_agent": "curl/7.47.0",
"created_via": "",
"customer_note": "",
"date_completed": "2016-05-30T19:35:16",
"date_paid": "2016-05-03 14:59:12",
"cart_hash": "",
"line_items": [
{
"id": 6,
"name": "Woo Single #2",
"sku": "12345",
"product_id": 99,
"variation_id": 0,
"quantity": 2,
"tax_class": "",
"price": "2.00",
"subtotal": "4.00",
"subtotal_tax": "0.00",
"total": "4.00",
"total_tax": "0.00",
"taxes": [],
"meta": []
}
],
"tax_lines": [],
"shipping_lines": [
{
"id": 7,
"method_title": "Flat Rate",
"method_id": "flat_rate",
"total": "10.00",
"total_tax": "0.00",
"taxes": []
}
],
"fee_lines": [],
"coupon_lines": [],
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v1/orders/116"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v1/orders"
}
],
"customer": [
{
"href": "https://example.com/wp-json/wc/v1/customers/1"
}
]
}
}
]
Parameter | Type | Description |
---|---|---|
context |
string | Scope under which the request is made; determines fields present in response. Options: view and edit . |
page |
integer | Current page of the collection. |
per_page |
integer | Maximum number of items to be returned in result set. |
search |
string | Limit results to those matching a string. |
after |
string | Limit response to resources published after a given ISO8601 compliant date. |
before |
string | Limit response to resources published before a given ISO8601 compliant date. |
exclude |
string | Ensure result set excludes specific ids. |
include |
string | Limit result set to specific ids. |
offset |
integer | Offset the result set by a specific number of items. |
order |
string | Order sort attribute ascending or descending. Default is asc . Options: asc and desc . |
orderby |
string | Sort collection by object attribute. Default is date , Options: date , id , include , title and slug . |
filter |
string | Use WP Query arguments to modify the response; private query vars require appropriate authorization. |
status |
string | Limit result set to orders assigned a specific status. Default is any . Options (plugins may add new status): any , pending , processing , on-hold , completed , cancelled , refunded and failed . |
customer |
string | Limit result set to orders assigned a specific customer. |
product |
string | Limit result set to orders assigned a specific product. |
dp |
string | Number of decimal points to use in each resource. |
This API lets you make changes to an order.
curl -X PUT https://example.com/wp-json/wc/v1/orders/154 \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"status": "completed"
}'
var data = {
status: 'completed'
};
WooCommerce.put('orders/154', data, function(err, data, res) {
console.log(res);
});
<?php
$data = [
'status' => 'completed'
];
print_r($woocommerce->put('orders/154', $data));
?>
data = {
"status": "completed"
}
print(wcapi.put("orders/154", data).json())
data = {
status: "completed"
}
woocommerce.put("orders/154", data).parsed_response
JSON response example:
{
"id": 154,
"parent_id": 0,
"status": "completed",
"order_key": "wc_order_574cc02467274",
"number": "154",
"currency": "USD",
"version": "2.6.0",
"prices_include_tax": false,
"date_created": "2016-05-30T22:35:16",
"date_modified": "2016-05-30T22:46:16",
"customer_id": 0,
"discount_total": "0.00",
"discount_tax": "0.00",
"shipping_total": "10.00",
"shipping_tax": "0.00",
"cart_tax": "1.95",
"total": "37.95",
"total_tax": "1.95",
"billing": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US",
"email": "[email protected]",
"phone": "(555) 555-5555"
},
"shipping": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US"
},
"payment_method": "bacs",
"payment_method_title": "bacs",
"transaction_id": "",
"customer_ip_address": "127.0.0.1",
"customer_user_agent": "curl/7.47.0",
"created_via": "rest-api",
"customer_note": "",
"date_completed": "2016-05-30T19:47:46",
"date_paid": "2016-05-30 19:35:25",
"cart_hash": "",
"line_items": [
{
"id": 18,
"name": "Woo Single #1",
"sku": "",
"product_id": 93,
"variation_id": 0,
"quantity": 2,
"tax_class": "",
"price": "3.00",
"subtotal": "6.00",
"subtotal_tax": "0.45",
"total": "6.00",
"total_tax": "0.45",
"taxes": [
{
"id": 75,
"total": 0.45,
"subtotal": 0.45
}
],
"meta": []
},
{
"id": 19,
"name": "Ship Your Idea",
"sku": "",
"product_id": 22,
"variation_id": 23,
"quantity": 1,
"tax_class": "",
"price": "20.00",
"subtotal": "20.00",
"subtotal_tax": "1.50",
"total": "20.00",
"total_tax": "1.50",
"taxes": [
{
"id": 75,
"total": 1.5,
"subtotal": 1.5
}
],
"meta": [
{
"key": "pa_color",
"label": "Color",
"value": "Black"
}
]
}
],
"tax_lines": [
{
"id": 21,
"rate_code": "US-CA-STATE TAX",
"rate_id": "75",
"label": "State Tax",
"compound": false,
"tax_total": "1.95",
"shipping_tax_total": "0.00"
}
],
"shipping_lines": [
{
"id": 20,
"method_title": "Flat Rate",
"method_id": "flat_rate",
"total": "10.00",
"total_tax": "0.00",
"taxes": []
}
],
"fee_lines": [],
"coupon_lines": [],
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v1/orders/154"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v1/orders"
}
]
}
}
This API helps you delete an order.
curl -X DELETE https://example.com/wp-json/wc/v1/orders/154?force=true \
-u consumer_key:consumer_secret
WooCommerce.delete('orders/154?force=true', function(err, data, res) {
console.log(res);
});
<?php print_r($woocommerce->delete('orders/154', ['force' => true])); ?>
print(wcapi.delete("orders/154?force=true").json())
woocommerce.delete("orders/154", force: true).parsed_response
JSON response example:
{
"id": 154,
"parent_id": 0,
"status": "completed",
"order_key": "wc_order_574cc02467274",
"number": "154",
"currency": "USD",
"version": "2.6.0",
"prices_include_tax": false,
"date_created": "2016-05-30T22:35:16",
"date_modified": "2016-05-30T22:46:16",
"customer_id": 0,
"discount_total": "0.00",
"discount_tax": "0.00",
"shipping_total": "10.00",
"shipping_tax": "0.00",
"cart_tax": "1.95",
"total": "37.95",
"total_tax": "1.95",
"billing": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US",
"email": "[email protected]",
"phone": "(555) 555-5555"
},
"shipping": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US"
},
"payment_method": "bacs",
"payment_method_title": "bacs",
"transaction_id": "",
"customer_ip_address": "127.0.0.1",
"customer_user_agent": "curl/7.47.0",
"created_via": "rest-api",
"customer_note": "",
"date_completed": "2016-05-30T19:47:46",
"date_paid": "2016-05-30 19:35:25",
"cart_hash": "",
"line_items": [
{
"id": 18,
"name": "Woo Single #1",
"sku": "",
"product_id": 93,
"variation_id": 0,
"quantity": 2,
"tax_class": "",
"price": "3.00",
"subtotal": "6.00",
"subtotal_tax": "0.45",
"total": "6.00",
"total_tax": "0.45",
"taxes": [
{
"id": 75,
"total": 0.45,
"subtotal": 0.45
}
],
"meta": []
},
{
"id": 19,
"name": "Ship Your Idea",
"sku": "",
"product_id": 22,
"variation_id": 23,
"quantity": 1,
"tax_class": "",
"price": "20.00",
"subtotal": "20.00",
"subtotal_tax": "1.50",
"total": "20.00",
"total_tax": "1.50",
"taxes": [
{
"id": 75,
"total": 1.5,
"subtotal": 1.5
}
],
"meta": [
{
"key": "pa_color",
"label": "Color",
"value": "Black"
}
]
}
],
"tax_lines": [
{
"id": 21,
"rate_code": "US-CA-STATE TAX",
"rate_id": "75",
"label": "State Tax",
"compound": false,
"tax_total": "1.95",
"shipping_tax_total": "0.00"
}
],
"shipping_lines": [
{
"id": 20,
"method_title": "Flat Rate",
"method_id": "flat_rate",
"total": "10.00",
"total_tax": "0.00",
"taxes": []
}
],
"fee_lines": [],
"coupon_lines": [],
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v1/orders/154"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v1/orders"
}
]
}
}
Parameter | Type | Description |
---|---|---|
force |
string | Use true whether to permanently delete the order, Default is false . |
This API helps you to batch create, update and delete multiple orders.
curl -X POST https://example.com/wp-json/wc/v1/orders/batch \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"create": [
{
"payment_method": "bacs",
"payment_method_title": "Direct Bank Transfer",
"billing": {
"first_name": "John",
"last_name": "Doe",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US",
"email": "[email protected]",
"phone": "(555) 555-5555"
},
"shipping": {
"first_name": "John",
"last_name": "Doe",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US"
},
"line_items": [
{
"product_id": 79,
"quantity": 1
},
{
"product_id": 93,
"quantity": 1
},
{
"product_id": 22,
"variation_id": 23,
"quantity": 1
}
],
"shipping_lines": [
{
"method_id": "flat_rate",
"method_title": "Flat Rate",
"total": 30
}
]
},
{
"payment_method": "bacs",
"payment_method_title": "Direct Bank Transfer",
"set_paid": true,
"billing": {
"first_name": "John",
"last_name": "Doe",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US",
"email": "[email protected]",
"phone": "(555) 555-5555"
},
"shipping": {
"first_name": "John",
"last_name": "Doe",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US"
},
"line_items": [
{
"product_id": 22,
"variation_id": 23,
"quantity": 1
},
{
"product_id": 22,
"variation_id": 24,
"quantity": 1
}
],
"shipping_lines": [
{
"method_id": "flat_rate",
"method_title": "Flat Rate",
"total": 20
}
]
}
],
"update": [
{
"id": 154,
"shipping_methods": "Local Delivery"
}
],
"delete": [
154
]
}'
var data = {
create: [
{
payment_method: 'bacs',
payment_method_title: 'Direct Bank Transfer',
billing: {
first_name: 'John',
last_name: 'Doe',
address_1: '969 Market',
address_2: '',
city: 'San Francisco',
state: 'CA',
postcode: '94103',
country: 'US',
email: '[email protected]',
phone: '(555) 555-5555'
},
shipping: {
first_name: 'John',
last_name: 'Doe',
address_1: '969 Market',
address_2: '',
city: 'San Francisco',
state: 'CA',
postcode: '94103',
country: 'US'
},
line_items: [
{
product_id: 79,
quantity: 1
},
{
product_id: 93,
quantity: 1
},
{
product_id: 22,
variation_id: 23,
quantity: 1
}
],
shipping_lines: [
{
method_id: 'flat_rate',
method_title: 'Flat Rate',
total: 30
}
]
},
{
payment_method: 'bacs',
payment_method_title: 'Direct Bank Transfer',
set_paid: true,
billing: {
first_name: 'John',
last_name: 'Doe',
address_1: '969 Market',
address_2: '',
city: 'San Francisco',
state: 'CA',
postcode: '94103',
country: 'US',
email: '[email protected]',
phone: '(555) 555-5555'
},
shipping: {
first_name: 'John',
last_name: 'Doe',
address_1: '969 Market',
address_2: '',
city: 'San Francisco',
state: 'CA',
postcode: '94103',
country: 'US'
},
line_items: [
{
product_id: 22,
variation_id: 23,
quantity: 1
},
{
product_id: 22,
variation_id: 24,
quantity: 1
}
],
shipping_lines: [
{
method_id: 'flat_rate',
method_title: 'Flat Rate',
total: 20
}
]
}
],
update: [
{
id: 154,
shipping_methods: 'Local Delivery'
}
],
delete: [
154
]
};
WooCommerce.post('orders/batch', data, function(err, data, res) {
console.log(res);
});
<?php
$data = [
'create' => [
[
'payment_method' => 'bacs',
'payment_method_title' => 'Direct Bank Transfer',
'billing' => [
'first_name' => 'John',
'last_name' => 'Doe',
'address_1' => '969 Market',
'address_2' => '',
'city' => 'San Francisco',
'state' => 'CA',
'postcode' => '94103',
'country' => 'US',
'email' => '[email protected]',
'phone' => '(555) 555-5555'
],
'shipping' => [
'first_name' => 'John',
'last_name' => 'Doe',
'address_1' => '969 Market',
'address_2' => '',
'city' => 'San Francisco',
'state' => 'CA',
'postcode' => '94103',
'country' => 'US'
],
'line_items' => [
[
'product_id' => 79,
'quantity' => 1
],
[
'product_id' => 93,
'quantity' => 1
],
[
'product_id' => 22,
'variation_id' => 23,
'quantity' => 1
]
],
'shipping_lines' => [
[
'method_id' => 'flat_rate',
'method_title' => 'Flat Rate',
'total' => 30
]
]
],
[
'payment_method' => 'bacs',
'payment_method_title' => 'Direct Bank Transfer',
'set_paid' => true,
'billing' => [
'first_name' => 'John',
'last_name' => 'Doe',
'address_1' => '969 Market',
'address_2' => '',
'city' => 'San Francisco',
'state' => 'CA',
'postcode' => '94103',
'country' => 'US',
'email' => '[email protected]',
'phone' => '(555) 555-5555'
],
'shipping' => [
'first_name' => 'John',
'last_name' => 'Doe',
'address_1' => '969 Market',
'address_2' => '',
'city' => 'San Francisco',
'state' => 'CA',
'postcode' => '94103',
'country' => 'US'
],
'line_items' => [
[
'product_id' => 22,
'variation_id' => 23,
'quantity' => 1
],
[
'product_id' => 22,
'variation_id' => 24,
'quantity' => 1
]
],
'shipping_lines' => [
[
'method_id' => 'flat_rate',
'method_title' => 'Flat Rate',
'total' => 20
]
]
]
],
'update' => [
[
'id' => 154,
'shipping_methods' => 'Local Delivery'
]
],
'delete' => [
154
]
];
print_r($woocommerce->post('orders/batch', $data));
?>
data = {
"create": [
{
"payment_method": "bacs",
"payment_method_title": "Direct Bank Transfer",
"billing": {
"first_name": "John",
"last_name": "Doe",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US",
"email": "[email protected]",
"phone": "(555) 555-5555"
},
"shipping": {
"first_name": "John",
"last_name": "Doe",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US"
},
"line_items": [
{
"product_id": 79,
"quantity": 1
},
{
"product_id": 93,
"quantity": 1
},
{
"product_id": 22,
"variation_id": 23,
"quantity": 1
}
],
"shipping_lines": [
{
"method_id": "flat_rate",
"method_title": "Flat Rate",
"total": 30
}
]
},
{
"payment_method": "bacs",
"payment_method_title": "Direct Bank Transfer",
"set_paid": True,
"billing": {
"first_name": "John",
"last_name": "Doe",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US",
"email": "[email protected]",
"phone": "(555) 555-5555"
},
"shipping": {
"first_name": "John",
"last_name": "Doe",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US"
},
"line_items": [
{
"product_id": 22,
"variation_id": 23,
"quantity": 1
},
{
"product_id": 22,
"variation_id": 24,
"quantity": 1
}
],
"shipping_lines": [
{
"method_id": "flat_rate",
"method_title": "Flat Rate",
"total": 20
}
]
}
],
"update": [
{
"id": 154,
"shipping_methods": "Local Delivery"
}
],
"delete": [
154
]
}
print(wcapi.post("orders/batch", data).json())
data = {
create: [
{
payment_method: "bacs",
payment_method_title: "Direct Bank Transfer",
billing: {
first_name: "John",
last_name: "Doe",
address_1: "969 Market",
address_2: "",
city: "San Francisco",
state: "CA",
postcode: "94103",
country: "US",
email: "[email protected]",
phone: "(555) 555-5555"
},
shipping: {
first_name: "John",
last_name: "Doe",
address_1: "969 Market",
address_2: "",
city: "San Francisco",
state: "CA",
postcode: "94103",
country: "US"
},
line_items: [
{
product_id: 79,
quantity: 1
},
{
product_id: 93,
quantity: 1
},
{
product_id: 22,
variation_id: 23,
quantity: 1
}
],
shipping_lines: [
{
method_id: "flat_rate",
method_title: "Flat Rate",
total: 30
}
]
},
{
payment_method: "bacs",
payment_method_title: "Direct Bank Transfer",
set_paid: true,
billing: {
first_name: "John",
last_name: "Doe",
address_1: "969 Market",
address_2: "",
city: "San Francisco",
state: "CA",
postcode: "94103",
country: "US",
email: "[email protected]",
phone: "(555) 555-5555"
},
shipping: {
first_name: "John",
last_name: "Doe",
address_1: "969 Market",
address_2: "",
city: "San Francisco",
state: "CA",
postcode: "94103",
country: "US"
},
line_items: [
{
product_id: 22,
variation_id: 23,
quantity: 1
},
{
product_id: 22,
variation_id: 24,
quantity: 1
}
],
shipping_lines: [
{
method_id: "flat_rate",
method_title: "Flat Rate",
total: 20
}
]
}
],
update: [
{
id: 154,
shipping_methods: "Local Delivery"
}
],
delete: [
154
]
}
woocommerce.post("orders/batch", data).parsed_response
JSON response example:
{
"create": [
{
"id": 155,
"parent_id": 0,
"status": "pending",
"order_key": "wc_order_574cc9541cea3",
"number": "155",
"currency": "USD",
"version": "2.6.0",
"prices_include_tax": false,
"date_created": "2016-05-30T23:14:28",
"date_modified": "2016-05-30T23:14:28",
"customer_id": 0,
"discount_total": "0.00",
"discount_tax": "0.00",
"shipping_total": "30.00",
"shipping_tax": "0.00",
"cart_tax": "2.85",
"total": "70.85",
"total_tax": "2.85",
"billing": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US",
"email": "[email protected]",
"phone": "(555) 555-5555"
},
"shipping": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US"
},
"payment_method": "bacs",
"payment_method_title": "bacs",
"transaction_id": "",
"customer_ip_address": "127.0.0.1",
"customer_user_agent": "curl/7.47.0",
"created_via": "rest-api",
"customer_note": "",
"date_completed": "2016-05-30T20:14:28",
"date_paid": "",
"cart_hash": "",
"line_items": [
{
"id": 22,
"name": "Woo Logo",
"sku": "",
"product_id": 79,
"variation_id": 0,
"quantity": 1,
"tax_class": "",
"price": "15.00",
"subtotal": "15.00",
"subtotal_tax": "1.13",
"total": "15.00",
"total_tax": "1.13",
"taxes": [
{
"id": 75,
"total": 1.125,
"subtotal": 1.125
}
],
"meta": []
},
{
"id": 23,
"name": "Woo Single #1",
"sku": "",
"product_id": 93,
"variation_id": 0,
"quantity": 1,
"tax_class": "",
"price": "3.00",
"subtotal": "3.00",
"subtotal_tax": "0.23",
"total": "3.00",
"total_tax": "0.23",
"taxes": [
{
"id": 75,
"total": 0.225,
"subtotal": 0.225
}
],
"meta": []
},
{
"id": 24,
"name": "Ship Your Idea",
"sku": "",
"product_id": 22,
"variation_id": 23,
"quantity": 1,
"tax_class": "",
"price": "20.00",
"subtotal": "20.00",
"subtotal_tax": "1.50",
"total": "20.00",
"total_tax": "1.50",
"taxes": [
{
"id": 75,
"total": 1.5,
"subtotal": 1.5
}
],
"meta": [
{
"key": "pa_color",
"label": "Color",
"value": "Black"
}
]
}
],
"tax_lines": [
{
"id": 26,
"rate_code": "US-CA-STATE TAX",
"rate_id": "75",
"label": "State Tax",
"compound": false,
"tax_total": "2.85",
"shipping_tax_total": "0.00"
}
],
"shipping_lines": [
{
"id": 25,
"method_title": "Flat Rate",
"method_id": "flat_rate",
"total": "30.00",
"total_tax": "0.00",
"taxes": []
}
],
"fee_lines": [],
"coupon_lines": [],
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v1/orders/155"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v1/orders"
}
]
}
},
{
"id": 156,
"parent_id": 0,
"status": "processing",
"order_key": "wc_order_574cc95465214",
"number": "156",
"currency": "USD",
"version": "2.6.0",
"prices_include_tax": false,
"date_created": "2016-05-30T23:14:28",
"date_modified": "2016-05-30T23:14:28",
"customer_id": 0,
"discount_total": "0.00",
"discount_tax": "0.00",
"shipping_total": "20.00",
"shipping_tax": "0.00",
"cart_tax": "3.00",
"total": "63.00",
"total_tax": "3.00",
"billing": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US",
"email": "[email protected]",
"phone": "(555) 555-5555"
},
"shipping": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US"
},
"payment_method": "bacs",
"payment_method_title": "bacs",
"transaction_id": "",
"customer_ip_address": "127.0.0.1",
"customer_user_agent": "curl/7.47.0",
"created_via": "rest-api",
"customer_note": "",
"date_completed": "2016-05-30T20:14:28",
"date_paid": "2016-05-30 20:14:37",
"cart_hash": "",
"line_items": [
{
"id": 27,
"name": "Ship Your Idea",
"sku": "",
"product_id": 22,
"variation_id": 23,
"quantity": 1,
"tax_class": "",
"price": "20.00",
"subtotal": "20.00",
"subtotal_tax": "1.50",
"total": "20.00",
"total_tax": "1.50",
"taxes": [
{
"id": 75,
"total": 1.5,
"subtotal": 1.5
}
],
"meta": [
{
"key": "pa_color",
"label": "Color",
"value": "Black"
}
]
},
{
"id": 28,
"name": "Ship Your Idea",
"sku": "",
"product_id": 22,
"variation_id": 24,
"quantity": 1,
"tax_class": "",
"price": "20.00",
"subtotal": "20.00",
"subtotal_tax": "1.50",
"total": "20.00",
"total_tax": "1.50",
"taxes": [
{
"id": 75,
"total": 1.5,
"subtotal": 1.5
}
],
"meta": [
{
"key": "pa_color",
"label": "Color",
"value": "Green"
}
]
}
],
"tax_lines": [
{
"id": 30,
"rate_code": "US-CA-STATE TAX",
"rate_id": "75",
"label": "State Tax",
"compound": false,
"tax_total": "3.00",
"shipping_tax_total": "0.00"
}
],
"shipping_lines": [
{
"id": 29,
"method_title": "Flat Rate",
"method_id": "flat_rate",
"total": "20.00",
"total_tax": "0.00",
"taxes": []
}
],
"fee_lines": [],
"coupon_lines": [],
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v1/orders/156"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v1/orders"
}
]
}
}
],
"update": [
{
"id": 154,
"parent_id": 0,
"status": "completed",
"order_key": "wc_order_574cc02467274",
"number": "154",
"currency": "USD",
"version": "2.6.0",
"prices_include_tax": false,
"date_created": "2016-05-30T22:35:16",
"date_modified": "2016-05-30T22:55:19",
"customer_id": 0,
"discount_total": "0.00",
"discount_tax": "0.00",
"shipping_total": "10.00",
"shipping_tax": "0.00",
"cart_tax": "1.95",
"total": "37.95",
"total_tax": "1.95",
"billing": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US",
"email": "[email protected]",
"phone": "(555) 555-5555"
},
"shipping": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US"
},
"payment_method": "bacs",
"payment_method_title": "bacs",
"transaction_id": "",
"customer_ip_address": "127.0.0.1",
"customer_user_agent": "curl/7.47.0",
"created_via": "rest-api",
"customer_note": "",
"date_completed": "2016-05-30T19:47:46",
"date_paid": "2016-05-30 19:35:25",
"cart_hash": "",
"line_items": [
{
"id": 18,
"name": "Woo Single #1",
"sku": "",
"product_id": 93,
"variation_id": 0,
"quantity": 2,
"tax_class": "",
"price": "3.00",
"subtotal": "6.00",
"subtotal_tax": "0.45",
"total": "6.00",
"total_tax": "0.45",
"taxes": [
{
"id": 75,
"total": 0.45,
"subtotal": 0.45
}
],
"meta": []
},
{
"id": 19,
"name": "Ship Your Idea",
"sku": "",
"product_id": 22,
"variation_id": 23,
"quantity": 1,
"tax_class": "",
"price": "20.00",
"subtotal": "20.00",
"subtotal_tax": "1.50",
"total": "20.00",
"total_tax": "1.50",
"taxes": [
{
"id": 75,
"total": 1.5,
"subtotal": 1.5
}
],
"meta": [
{
"key": "pa_color",
"label": "Color",
"value": "Black"
}
]
}
],
"tax_lines": [
{
"id": 21,
"rate_code": "US-CA-STATE TAX",
"rate_id": "75",
"label": "State Tax",
"compound": false,
"tax_total": "1.95",
"shipping_tax_total": "0.00"
}
],
"shipping_lines": [
{
"id": 20,
"method_title": "Flat Rate",
"method_id": "flat_rate",
"total": "10.00",
"total_tax": "0.00",
"taxes": []
}
],
"fee_lines": [],
"coupon_lines": [],
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v1/orders/154"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v1/orders"
}
]
}
}
],
"delete": [
{
"id": 154,
"parent_id": 0,
"status": "completed",
"order_key": "wc_order_574cc02467274",
"number": "154",
"currency": "USD",
"version": "2.6.0",
"prices_include_tax": false,
"date_created": "2016-05-30T22:35:16",
"date_modified": "2016-05-30T22:55:19",
"customer_id": 0,
"discount_total": "0.00",
"discount_tax": "0.00",
"shipping_total": "10.00",
"shipping_tax": "0.00",
"cart_tax": "1.95",
"total": "37.95",
"total_tax": "1.95",
"billing": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US",
"email": "[email protected]",
"phone": "(555) 555-5555"
},
"shipping": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US"
},
"payment_method": "bacs",
"payment_method_title": "bacs",
"transaction_id": "",
"customer_ip_address": "127.0.0.1",
"customer_user_agent": "curl/7.47.0",
"created_via": "rest-api",
"customer_note": "",
"date_completed": "2016-05-30T19:47:46",
"date_paid": "2016-05-30 19:35:25",
"cart_hash": "",
"line_items": [
{
"id": 18,
"name": "Woo Single #1",
"sku": "",
"product_id": 93,
"variation_id": 0,
"quantity": 2,
"tax_class": "",
"price": "3.00",
"subtotal": "6.00",
"subtotal_tax": "0.45",
"total": "6.00",
"total_tax": "0.45",
"taxes": [
{
"id": 75,
"total": 0.45,
"subtotal": 0.45
}
],
"meta": []
},
{
"id": 19,
"name": "Ship Your Idea",
"sku": "",
"product_id": 22,
"variation_id": 23,
"quantity": 1,
"tax_class": "",
"price": "20.00",
"subtotal": "20.00",
"subtotal_tax": "1.50",
"total": "20.00",
"total_tax": "1.50",
"taxes": [
{
"id": 75,
"total": 1.5,
"subtotal": 1.5
}
],
"meta": [
{
"key": "pa_color",
"label": "Color",
"value": "Black"
}
]
}
],
"tax_lines": [
{
"id": 21,
"rate_code": "US-CA-STATE TAX",
"rate_id": "75",
"label": "State Tax",
"compound": false,
"tax_total": "1.95",
"shipping_tax_total": "0.00"
}
],
"shipping_lines": [
{
"id": 20,
"method_title": "Flat Rate",
"method_id": "flat_rate",
"total": "10.00",
"total_tax": "0.00",
"taxes": []
}
],
"fee_lines": [],
"coupon_lines": [],
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v1/orders/154"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v1/orders"
}
]
}
}
]
}