Skip to content

Commit 20d14c8

Browse files
committed
Fixes in the documentation for order refunds:
- "refund_amount" fields fixed to "refund_total" - "amount" values turned into strings - Added missing "amount" field in one of the examples
1 parent 1d8a553 commit 20d14c8

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

Diff for: source/includes/wp-api-v3/_order-refunds.md

+14-13
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,15 @@ curl -X POST https://example.com/wp-json/wc/v3/orders/723/refunds \
7272
-u consumer_key:consumer_secret \
7373
-H "Content-Type: application/json" \
7474
-d '{
75+
"amount": "30",
7576
"line_items": [
7677
{
7778
"id": "111",
78-
"refund_amount": 10,
79+
"refund_total": 10,
7980
"refund_tax": [
8081
{
8182
"id" "222",
82-
"refund_amount": 20
83+
"refund_total": 20
8384
}
8485
]
8586
}
@@ -88,15 +89,15 @@ curl -X POST https://example.com/wp-json/wc/v3/orders/723/refunds \
8889

8990
```javascript
9091
const data = {
91-
amount: 30,
92+
amount: "30",
9293
line_items: [
9394
{
9495
id: "111",
95-
refund_amount: 10,
96+
refund_total: 10,
9697
refund_tax: [
9798
{
9899
id: "222",
99-
refund_amount: 20
100+
refund_total: 20
100101
}
101102
]
102103
}
@@ -115,11 +116,11 @@ WooCommerce.post("orders/723/refunds", data)
115116
```php
116117
<?php
117118
$data = [
118-
'amount' => 30,
119+
'amount' => '30',
119120
'line_items' => [
120121
[
121122
'id' => '111',
122-
'refund_amount' => 10,
123+
'refund_total' => 10,
123124
'refund_tax' => [
124125
[
125126
'id' => '222',
@@ -136,15 +137,15 @@ print_r($woocommerce->post('orders/723/refunds', $data));
136137

137138
```python
138139
data = {
139-
"amount": 30,
140+
"amount": "30",
140141
"line_items": [
141142
{
142143
"id": "111",
143-
"refund_amount": 10,
144+
"refund_total": 10,
144145
"refund_tax": [
145146
{
146147
"id" "222",
147-
"refund_amount": 20
148+
"refund_total": 20
148149
}
149150
]
150151
}
@@ -156,15 +157,15 @@ print(wcapi.post("orders/723/refunds", data).json())
156157

157158
```ruby
158159
data = {
159-
amount: 30,
160+
amount: "30",
160161
line_items: [
161162
{
162163
id: "111",
163-
refund_amount: 10,
164+
refund_total: 10,
164165
refund_tax: [
165166
{
166167
id "222",
167-
refund_amount: 20
168+
refund_total: 20
168169
}
169170
]
170171
}

0 commit comments

Comments
 (0)