Change an order's status
wp_wc_update_order_statusUpdate a WooCommerce order to a valid shop status, optionally adding a private order note. Unknown statuses are rejected with the list of supported statuses.
Instructions
WooCommerce: set one order to one of the statuses this shop knows (processing, completed, on-hold, cancelled, refunded, … plus any a plugin registers); an unknown status is refused, with the list of known ones. Only the status changes: no payment is touched and no money moves, but WooCommerce reacts as in the order screen (status e-mails, stock handling, whatever plugins attach to the transition), and "refunded" makes it record a full refund of what is still unrefunded (wc_order_fully_refunded), which shows in the shop's reports. A note is added as a private order note of its own, beside WooCommerce's transition note, on every call that carries one, also when the status was already set. Returns updated, id, status and status_unchanged; an unknown order is a not-found error. Needs manage_woocommerce and the right to edit this order (edit_shop_order), which a site can withhold for single orders; no undo point is recorded. Requires WooCommerce.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Order id, as wp_wc_list_orders returns it. | |
| note | No | Optional private order note, added as an entry of its own. Omitted: no note besides WooCommerce's own. | |
| status | Yes | One of the shop's order statuses, with or without the wc- prefix. |