@@ -108,7 +108,7 @@ The products API allows you to create, view, update, and delete individual, or a
108
108
109
109
| Attribute | Type | Description |
110
110
| ---------------------| -----------| ---------------------------------------------------------------------------------------------------------|
111
- | ` id ` | integer | Image ID. |
111
+ | ` id ` | integer | The attachment ID from the Media Library. |
112
112
| ` date_created ` | date-time | The date the image was created, in the site's timezone. <i class =" label label-info " >read-only</i > |
113
113
| ` date_created_gmt ` | date-time | The date the image was created, as GMT. <i class =" label label-info " >read-only</i > |
114
114
| ` date_modified ` | date-time | The date the image was last modified, in the site's timezone. <i class =" label label-info " >read-only</i > |
@@ -157,7 +157,7 @@ This API helps you to create a new product.
157
157
</div>
158
158
</div >
159
159
160
- > Example of how to create a ` simple ` product:
160
+ > Example of how to create a ` simple ` product with one existing image and one new image :
161
161
162
162
``` shell
163
163
curl -X POST https://example.com/wp-json/wc/v3/products \
@@ -179,7 +179,7 @@ curl -X POST https://example.com/wp-json/wc/v3/products \
179
179
],
180
180
"images": [
181
181
{
182
- "src ": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
182
+ "id ": 42
183
183
},
184
184
{
185
185
"src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg"
@@ -205,7 +205,7 @@ const data = {
205
205
],
206
206
images: [
207
207
{
208
- src : " http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg "
208
+ id : 42
209
209
},
210
210
{
211
211
src: " http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg"
@@ -240,7 +240,7 @@ $data = [
240
240
],
241
241
'images' => [
242
242
[
243
- 'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg'
243
+ 'id': 42
244
244
],
245
245
[
246
246
'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg'
@@ -269,7 +269,7 @@ data = {
269
269
],
270
270
" images" : [
271
271
{
272
- " src " : " http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg "
272
+ " id " : 42
273
273
},
274
274
{
275
275
" src" : " http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg"
@@ -297,7 +297,7 @@ data = {
297
297
],
298
298
images: [
299
299
{
300
- src: " http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg "
300
+ id: 42
301
301
},
302
302
{
303
303
src: " http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg" ,
@@ -393,11 +393,11 @@ woocommerce.post("products", data).parsed_response
393
393
"tags" : [],
394
394
"images" : [
395
395
{
396
- "id" : 792 ,
397
- "date_created" : " 2017-03-23T14 :01:13" ,
398
- "date_created_gmt" : " 2017-03-23T20 :01:13" ,
399
- "date_modified" : " 2017-03-23T14 :01:13" ,
400
- "date_modified_gmt" : " 2017-03-23T20 :01:13" ,
396
+ "id" : 42 ,
397
+ "date_created" : " 2017-03-22T14 :01:13" ,
398
+ "date_created_gmt" : " 2017-03-22T20 :01:13" ,
399
+ "date_modified" : " 2017-03-22T14 :01:13" ,
400
+ "date_modified_gmt" : " 2017-03-22T20 :01:13" ,
401
401
"src" : " https://example.com/wp-content/uploads/2017/03/T_2_front-4.jpg" ,
402
402
"name" : " " ,
403
403
"alt" : " "
0 commit comments