The order actions API allows you to perform specific actions with existing orders like you can from the Edit Order screen in the web app.
Note: currently only one action is available, other actions will be introduced at a later time.
This endpoint allows you to trigger an email to the customer with the details of their order, if the order contains a customer email address.
curl -X POST https://example.com/wp-json/wc/v3/orders/723/actions/send_order_details \
-u consumer_key:consumer_secret
WooCommerce.post("orders/723/actions/send_order_details")
.then((response) => {
console.log(response.data);
})
.catch((error) => {
console.log(error.response.data);
});
<?php
print_r($woocommerce->post('orders/723/actions/send_order_details'));
?>
print(wcapi.post("orders/723/actions/send_order_details").json())
woocommerce.post("orders/723/actions/send_order_details").parsed_response
JSON response examples:
{
"message": "Order details sent to [email protected], via REST API."
}
{
"code": "woocommerce_rest_missing_email",
"message": "Order does not have an email address.",
"data": {
"status": 400
}
}