Skip to content

Latest commit

 

History

History
65 lines (51 loc) · 1.46 KB

_order-actions.md

File metadata and controls

65 lines (51 loc) · 1.46 KB

Order actions

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.

Send order details to customer

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.

HTTP request

POST
/wp-json/wc/v3/orders/<id>/actions/send_order_details
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
	}
}