From d2f9d36e956b03e09cf07e234e7b1aac7ebc64e5 Mon Sep 17 00:00:00 2001
From: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
Date: Tue, 12 Nov 2024 16:25:24 -0800
Subject: [PATCH 1/2] Orders: Add doc for order actions
Adds documentation for the REST endpoint introduced in
https://github.com/woocommerce/woocommerce/pull/52050
---
source/includes/wp-api-v3/_order-actions.md | 65 +++++++++++++++++++++
source/index.html.md | 1 +
2 files changed, 66 insertions(+)
create mode 100644 source/includes/wp-api-v3/_order-actions.md
diff --git a/source/includes/wp-api-v3/_order-actions.md b/source/includes/wp-api-v3/_order-actions.md
new file mode 100644
index 0000000..8c93f09
--- /dev/null
+++ b/source/includes/wp-api-v3/_order-actions.md
@@ -0,0 +1,65 @@
+# 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 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
+
+
+
+```shell
+curl -X POST https://example.com/wp-json/wc/v3/orders/723/actions/send_order_details \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.post("orders/723/actions/send_order_details")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+```php
+post('orders/723/actions/send_order_details'));
+?>
+```
+
+```python
+print(wcapi.post("orders/723/actions/send_order_details").json())
+```
+
+```ruby
+woocommerce.post("orders/723/actions/send_order_details").parsed_response
+```
+
+> JSON response examples:
+
+```json
+{
+ "message": "Order details sent to woo@example.com, via REST API."
+}
+```
+
+```json
+{
+ "code": "woocommerce_rest_missing_email",
+ "message": "Order does not have an email address.",
+ "data": {
+ "status": 400
+ }
+}
+```
diff --git a/source/index.html.md b/source/index.html.md
index 28684b9..126d8a9 100644
--- a/source/index.html.md
+++ b/source/index.html.md
@@ -24,6 +24,7 @@ includes:
- wp-api-v3/coupons
- wp-api-v3/customers
- wp-api-v3/orders
+ - wp-api-v3/order-actions
- wp-api-v3/order-notes
- wp-api-v3/order-refunds
- wp-api-v3/products
From 91a5d70642e6c885c614d3d2ccc1f5b906590bdc Mon Sep 17 00:00:00 2001
From: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
Date: Tue, 12 Nov 2024 16:31:17 -0800
Subject: [PATCH 2/2] Add missing word
---
source/includes/wp-api-v3/_order-actions.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/includes/wp-api-v3/_order-actions.md b/source/includes/wp-api-v3/_order-actions.md
index 8c93f09..c551bd9 100644
--- a/source/includes/wp-api-v3/_order-actions.md
+++ b/source/includes/wp-api-v3/_order-actions.md
@@ -2,7 +2,7 @@
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 introduced at a later time._
+_Note: currently only one action is available, other actions will be introduced at a later time._
## Send order details to customer ##