File tree 1 file changed +59
-71
lines changed
source/includes/wp-api-v3
1 file changed +59
-71
lines changed Original file line number Diff line number Diff line change @@ -72,41 +72,35 @@ curl -X POST https://example.com/wp-json/wc/v3/orders/723/refunds \
72
72
-u consumer_key:consumer_secret \
73
73
-H " Content-Type: application/json" \
74
74
-d ' {
75
- "order_refund": {
76
- "amount": 30,
77
- "line_items": [
78
- {
79
- "id": "111",
80
- "refund_amount": 10,
81
- "refund_tax": [
82
- {
83
- "id" "222",
84
- "refund_amount": 20
85
- }
86
- ]
87
- }
88
- ]
89
- }
75
+ "line_items": [
76
+ {
77
+ "id": "111",
78
+ "refund_amount": 10,
79
+ "refund_tax": [
80
+ {
81
+ "id" "222",
82
+ "refund_amount": 20
83
+ }
84
+ ]
85
+ }
90
86
}'
91
87
```
92
88
93
89
``` javascript
94
90
const data = {
95
- " order_refund" : {
96
- " amount" : 30 ,
97
- " line_items" : [
98
- {
99
- " id" : " 111" ,
100
- " refund_amount" : 10 ,
101
- " refund_tax" : [
102
- {
103
- " id" " 222" ,
104
- " refund_amount" : 20
105
- }
106
- ]
107
- }
108
- ]
109
- }
91
+ amount: 30 ,
92
+ line_items: [
93
+ {
94
+ id: " 111" ,
95
+ refund_amount: 10 ,
96
+ refund_tax: [
97
+ {
98
+ id: " 222" ,
99
+ refund_amount: 20
100
+ }
101
+ ]
102
+ }
103
+ ]
110
104
};
111
105
112
106
WooCommerce .post (" orders/723/refunds" , data)
@@ -121,21 +115,19 @@ WooCommerce.post("orders/723/refunds", data)
121
115
``` php
122
116
<?php
123
117
$data = [
124
- 'order_refund' => [
125
- 'amount' => 30,
126
- 'line_items' => [
127
- [
128
- 'id' => '111',
129
- 'refund_amount' => 10,
130
- 'refund_tax' => [
131
- [
132
- 'id' => '222',
133
- 'amount' => 20
134
- ]
118
+ 'amount' => 30,
119
+ 'line_items' => [
120
+ [
121
+ 'id' => '111',
122
+ 'refund_amount' => 10,
123
+ 'refund_tax' => [
124
+ [
125
+ 'id' => '222',
126
+ 'amount' => 20
135
127
]
136
- ]
137
- ]
138
- ]
128
+ ]
129
+ ]
130
+ ]
139
131
];
140
132
141
133
print_r($woocommerce->post('orders/723/refunds', $data));
@@ -144,43 +136,39 @@ print_r($woocommerce->post('orders/723/refunds', $data));
144
136
145
137
``` python
146
138
data = {
147
- " order_refund" : {
148
- " amount" : 30 ,
149
- " line_items" : [
150
- {
151
- " id" : " 111" ,
152
- " refund_amount" : 10 ,
153
- " refund_tax" : [
154
- {
155
- " id" " 222" ,
156
- " refund_amount" : 20
157
- }
158
- ]
159
- }
160
- ]
161
- }
139
+ " amount" : 30 ,
140
+ " line_items" : [
141
+ {
142
+ " id" : " 111" ,
143
+ " refund_amount" : 10 ,
144
+ " refund_tax" : [
145
+ {
146
+ " id" " 222" ,
147
+ " refund_amount" : 20
148
+ }
149
+ ]
150
+ }
151
+ ]
162
152
}
163
153
164
154
print (wcapi.post(" orders/723/refunds" , data).json())
165
155
```
166
156
167
157
``` ruby
168
158
data = {
169
- order_refund: {
170
- amount: 30 ,
171
- line_items: [
159
+ amount: 30 ,
160
+ line_items: [
161
+ {
162
+ id: " 111" ,
163
+ refund_amount: 10 ,
164
+ refund_tax: [
172
165
{
173
- id: " 111" ,
174
- refund_amount: 10 ,
175
- refund_tax: [
176
- {
177
- id " 222" ,
178
- refund_amount: 20
179
- }
180
- ]
166
+ id " 222" ,
167
+ refund_amount: 20
181
168
}
182
- ]
169
+ ]
183
170
}
171
+ ]
184
172
}
185
173
186
174
woocommerce.post(" orders/723/refunds" , data).parsed_response
You can’t perform that action at this time.
0 commit comments