File tree 2 files changed +66
-0
lines changed
2 files changed +66
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Order actions #
2
+
3
+ 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.
4
+
5
+ _ Note: currently only one action is available, other actions will be introduced at a later time._
6
+
7
+ ## Send order details to customer ##
8
+
9
+ 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.
10
+
11
+ ### HTTP request ###
12
+
13
+ <div class =" api-endpoint " >
14
+ <div class="endpoint-data">
15
+ <i class="label label-post">POST</i>
16
+ <h6>/wp-json/wc/v3/orders/<id>/actions/send_order_details</h6>
17
+ </div>
18
+ </div >
19
+
20
+ ``` shell
21
+ curl -X POST https://example.com/wp-json/wc/v3/orders/723/actions/send_order_details \
22
+ -u consumer_key:consumer_secret
23
+ ```
24
+
25
+ ``` javascript
26
+ WooCommerce .post (" orders/723/actions/send_order_details" )
27
+ .then ((response ) => {
28
+ console .log (response .data );
29
+ })
30
+ .catch ((error ) => {
31
+ console .log (error .response .data );
32
+ });
33
+ ```
34
+
35
+ ``` php
36
+ <?php
37
+ print_r($woocommerce->post('orders/723/actions/send_order_details'));
38
+ ?>
39
+ ```
40
+
41
+ ``` python
42
+ print (wcapi.post(" orders/723/actions/send_order_details" ).json())
43
+ ```
44
+
45
+ ``` ruby
46
+ woocommerce.post(" orders/723/actions/send_order_details" ).parsed_response
47
+ ```
48
+
49
+ > JSON response examples:
50
+
51
+ ``` json
52
+ {
53
+ "message" : " Order details sent to woo@example.com, via REST API."
54
+ }
55
+ ```
56
+
57
+ ``` json
58
+ {
59
+ "code" : " woocommerce_rest_missing_email" ,
60
+ "message" : " Order does not have an email address." ,
61
+ "data" : {
62
+ "status" : 400
63
+ }
64
+ }
65
+ ```
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ includes:
24
24
- wp-api-v3/coupons
25
25
- wp-api-v3/customers
26
26
- wp-api-v3/orders
27
+ - wp-api-v3/order-actions
27
28
- wp-api-v3/order-notes
28
29
- wp-api-v3/order-refunds
29
30
- wp-api-v3/products
You can’t perform that action at this time.
0 commit comments