Class WC_API_Orders

WC_API_Resource
Extended by WC_API_Orders
Package: WooCommerce\API
Author: WooThemes
Located at includes/api/class-wc-api-orders.php

Methods summary

public array
# register_routes( array $routes )

Register the routes for this class

Register the routes for this class

GET /orders GET /orders/count GET|PUT /orders/<id> GET /orders/<id>/notes

Parameters

$routes
array
$routes

Returns

array

Since

2.1
public array
# get_orders( string $fields = null, array $filter = array(), string $status = null, integer $page = 1 )

Get all orders

Get all orders

Parameters

$fields
string
$fields
$filter
array
$filter
$status
string
$status
$page
integer
$page

Returns

array

Since

2.1
public array
# get_order( integer $id, array $fields = null )

Get the order for the given ID

Get the order for the given ID

Parameters

$id
integer
$id the order ID
$fields
array
$fields

Returns

array

Since

2.1
public array
# get_orders_count( string $status = null, array $filter = array() )

Get the total number of orders

Get the total number of orders

Parameters

$status
string
$status
$filter
array
$filter

Returns

array

Since

2.1
public array
# edit_order( integer $id, array $data )

Edit an order

Edit an order

API v1 only allows updating the status of an order

Parameters

$id
integer
$id the order ID
$data
array
$data

Returns

array

Since

2.1
public array
# delete_order( integer $id, boolean $force = false )

Delete an order

Delete an order

Parameters

$id
integer
$id the order ID
$force
boolean
$force true to permanently delete order, false to move to trash

Returns

array

TODO

enable along with POST in 2.2
public array
# get_order_notes( integer $id, string $fields = null )

Get the admin order notes for an order

Get the admin order notes for an order

Parameters

$id
integer
$id the order ID
$fields
string
$fields fields to include in response

Returns

array

Since

2.1

Methods inherited from WC_API_Resource

__construct(), delete(), filter_response_fields(), is_deletable(), is_editable(), is_readable(), maybe_add_meta(), merge_query_args(), validate_request()

Magic methods summary

Properties summary

protected string $base
#

$base the route base

$base the route base

Properties inherited from WC_API_Resource

$server

WooCommerce API documentation generated by ApiGen 2.8.0