@@ -979,7 +979,7 @@ woocommerce.post("products", data).parsed_response
979
979
980
980
## View A Product ##
981
981
982
- This API lets you retrieve and view a specific product by ID or sku .
982
+ This API lets you retrieve and view a specific product by ID.
983
983
984
984
### HTTP Request ###
985
985
@@ -2089,22 +2089,22 @@ This API helps you delete a product.
2089
2089
</div >
2090
2090
2091
2091
``` shell
2092
- curl -X DELETE https://example.com/wc-api/v3/products/546/ ? force=true \
2092
+ curl -X DELETE https://example.com/wc-api/v3/products/546? force=true \
2093
2093
-u consumer_key:consumer_secret
2094
2094
```
2095
2095
2096
2096
``` javascript
2097
- WooCommerce .delete (' products/546/ ?force=true' , function (err , data , res ) {
2097
+ WooCommerce .delete (' products/546?force=true' , function (err , data , res ) {
2098
2098
console .log (res);
2099
2099
});
2100
2100
```
2101
2101
2102
2102
``` python
2103
- print (wcapi.delete(" products/546/ ?force=true" ).json())
2103
+ print (wcapi.delete(" products/546?force=true" ).json())
2104
2104
```
2105
2105
2106
2106
``` ruby
2107
- woocommerce.delete(" products/546" ).parsed_response
2107
+ woocommerce.delete(" products/546?force=true " ).parsed_response
2108
2108
```
2109
2109
2110
2110
> JSON response example:
@@ -2168,74 +2168,333 @@ woocommerce.get("products/count").parsed_response
2168
2168
| ` type ` | string | Products by type. eg: ` simple ` or ` variable ` |
2169
2169
| ` category ` | string | Products by category. |
2170
2170
2171
- ## View List Of Product Reviews ##
2171
+ ## Create A Product Attribute ##
2172
+
2173
+ This API helps you to create a new product attribute.
2174
+
2175
+ ### HTTP Request ###
2176
+
2177
+ <div class =" api-endpoint " >
2178
+ <div class="endpoint-data">
2179
+ <i class="label label-post">POST</i>
2180
+ <h6>/wc-api/v3/products/attributes</h6>
2181
+ </div>
2182
+ </div >
2183
+
2184
+ ``` shell
2185
+ curl -X POST https://example.com/wc-api/v3/products/attributes \
2186
+ -u consumer_key:consumer_secret \
2187
+ -H " Content-Type: application/json" \
2188
+ -d ' {
2189
+ "product_attribute": {
2190
+ "name": "Color",
2191
+ "slug": "pa_color",
2192
+ "type": "select",
2193
+ "order_by": "menu_order",
2194
+ "has_archives": true
2195
+ }
2196
+ }'
2197
+ ```
2198
+
2199
+ ``` javascript
2200
+ var data = {
2201
+ product_attribute: {
2202
+ name: " Color" ,
2203
+ slug: " pa_color" ,
2204
+ type: " select" ,
2205
+ order_by: " menu_order" ,
2206
+ has_archives: true
2207
+ }
2208
+ };
2209
+
2210
+ WooCommerce .post (' products/attributes' , data, function (err , data , res ) {
2211
+ console .log (res);
2212
+ });
2213
+ ```
2214
+
2215
+ ``` python
2216
+ data = {
2217
+ " product_attribute" : {
2218
+ " name" : " Color" ,
2219
+ " slug" : " pa_color" ,
2220
+ " type" : " select" ,
2221
+ " order_by" : " menu_order" ,
2222
+ " has_archives" : True
2223
+ }
2224
+ }
2225
+
2226
+ print (wcapi.post(" products/attributes" , data).json())
2227
+ ```
2228
+
2229
+ ``` ruby
2230
+ data = {
2231
+ product_attribute: {
2232
+ name: " Color" ,
2233
+ slug: " pa_color" ,
2234
+ type: " select" ,
2235
+ order_by: " menu_order" ,
2236
+ has_archives: true
2237
+ }
2238
+ }
2239
+
2240
+ woocommerce.post(" products/attributes" , data).parsed_response
2241
+ ```
2242
+
2243
+ > JSON response example:
2244
+
2245
+ ``` json
2246
+ {
2247
+ "product_attribute" : {
2248
+ "id" : 1 ,
2249
+ "name" : " Color" ,
2250
+ "slug" : " pa_color" ,
2251
+ "type" : " select" ,
2252
+ "order_by" : " menu_order" ,
2253
+ "has_archives" : true
2254
+ }
2255
+ }
2256
+ ```
2257
+
2258
+ ### Product Attribute Properties ###
2259
+
2260
+ | Attribute | Type | Description |
2261
+ | -------------- | ------- | -------------------------------------------------------------------------------------------------------------------- |
2262
+ | ` id ` | integer | Attribute ID <i class =" label label-info " >read-only</i > |
2263
+ | ` name ` | string | Attribute name |
2264
+ | ` slug ` | string | Attribute slug |
2265
+ | ` type ` | string | Attribute type, the types available include by default are: ` select ` and ` text ` (some plugins can include new types) |
2266
+ | ` order_by ` | string | Default sort order. Available: ` menu_order ` , ` name ` , ` name_num ` and ` id ` |
2267
+ | ` has_archives ` | boolean | Enable/Disable attribute archives |
2268
+
2269
+ ## View A Product Attribute ##
2270
+
2271
+ This API lets you retrieve and view a specific product attribute by ID.
2172
2272
2173
2273
<div class =" api-endpoint " >
2174
2274
<div class="endpoint-data">
2175
2275
<i class="label label-get">GET</i>
2176
- <h6>/wc-api/v3/products/<id>/reviews </h6>
2276
+ <h6>/wc-api/v3/products/attributes/ <id></h6>
2177
2277
</div>
2178
2278
</div >
2179
2279
2180
2280
``` shell
2181
- curl https://example.com/wc-api/v3/products/546/reviews \
2281
+ curl https://example.com/wc-api/v3/products/attributes/1 \
2182
2282
-u consumer_key:consumer_secret
2183
2283
```
2184
2284
2185
2285
``` javascript
2186
- WooCommerce .get (' products/546/reviews ' , function (err , data , res ) {
2286
+ WooCommerce .get (' products/attributes/1 ' , function (err , data , res ) {
2187
2287
console .log (res);
2188
2288
});
2189
2289
```
2190
2290
2191
2291
``` python
2192
- print (wcapi.get(" products/546/reviews " ).json())
2292
+ print (wcapi.get(" products/attributes/1 " ).json())
2193
2293
```
2194
2294
2195
2295
``` ruby
2196
- woocommerce.get(" products/546/reviews " ).parsed_response
2296
+ woocommerce.get(" products/attributes/1 " ).parsed_response
2197
2297
```
2198
2298
2199
2299
> JSON response example:
2200
2300
2201
2301
``` json
2202
2302
{
2203
- "product_reviews" : [
2303
+ "product_attribute" : {
2304
+ "id" : 1 ,
2305
+ "name" : " Color" ,
2306
+ "slug" : " pa_color" ,
2307
+ "type" : " select" ,
2308
+ "order_by" : " menu_order" ,
2309
+ "has_archives" : true
2310
+ }
2311
+ }
2312
+ ```
2313
+
2314
+ <aside class =" notice " >
2315
+ View the <a href="#product-attribute-properties">Product Attribute Properties</a> for more details on this response.
2316
+ </aside >
2317
+
2318
+ ## View List Of Product Attributes ##
2319
+
2320
+ This API helps you to view all the product attributes.
2321
+
2322
+ ### HTTP Request ###
2323
+
2324
+ <div class =" api-endpoint " >
2325
+ <div class="endpoint-data">
2326
+ <i class="label label-get">GET</i>
2327
+ <h6>/wc-api/v3/products/attributes</h6>
2328
+ </div>
2329
+ </div >
2330
+
2331
+ ``` shell
2332
+ curl https://example.com/wc-api/v3/products/attributes \
2333
+ -u consumer_key:consumer_secret
2334
+ ```
2335
+
2336
+ ``` javascript
2337
+ WooCommerce .get (' products/attributes' , function (err , data , res ) {
2338
+ console .log (res);
2339
+ });
2340
+ ```
2341
+
2342
+ ``` python
2343
+ print (wcapi.get(" products/attributes" ).json())
2344
+ ```
2345
+
2346
+ ``` ruby
2347
+ woocommerce.get(" products/attributes" ).parsed_response
2348
+ ```
2349
+
2350
+ > JSON response example:
2351
+
2352
+ ``` json
2353
+ {
2354
+ "product_attributes" : [
2204
2355
{
2205
- "id" : 4 ,
2206
- "created_at" : " 2013-06-07T11:57:45Z" ,
2207
- "review" : " This t-shirt is awesome! Would recommend to everyone!\n\n I'm ordering mine next week" ,
2208
- "rating" : " 5" ,
2209
- "reviewer_name" : " Andrew" ,
2210
- "reviewer_email" : " andrew@example.com" ,
2211
- "verified" : false
2356
+ "id" : 1 ,
2357
+ "name" : " Color" ,
2358
+ "slug" : " pa_color" ,
2359
+ "type" : " select" ,
2360
+ "order_by" : " menu_order" ,
2361
+ "has_archives" : true
2212
2362
},
2213
2363
{
2214
- "id" : 3 ,
2215
- "created_at" : " 2013-06-07T11:53:49Z" ,
2216
- "review" : " Wonderful quality, and an awesome design. WooThemes ftw!" ,
2217
- "rating" : " 4" ,
2218
- "reviewer_name" : " Cobus Bester" ,
2219
- "reviewer_email" : " cobus@example.com" ,
2220
- "verified" : false
2364
+ "id" : 2 ,
2365
+ "name" : " Size" ,
2366
+ "slug" : " pa_size" ,
2367
+ "type" : " select" ,
2368
+ "order_by" : " menu_order" ,
2369
+ "has_archives" : false
2221
2370
}
2222
2371
]
2223
2372
}
2224
2373
```
2225
2374
2226
- ### Product Reviews Properties ###
2375
+ <aside class =" notice " >
2376
+ View the <a href="#product-attribute-properties">Product Attribute Properties</a> for more details on this response.
2377
+ </aside >
2227
2378
2228
- | Attribute | Type | Description |
2229
- | ---------------- | ------- | ----------------------------------------------------------------------------------------- |
2230
- | ` id ` | integer | Review ID (comment ID) <i class =" label label-info " >read-only</i > |
2231
- | ` created_at ` | string | UTC DateTime when the review was created <i class =" label label-info " >read-only</i > |
2232
- | ` rating ` | string | Review rating (0 to 5) <i class =" label label-info " >read-only</i > |
2233
- | ` reviewer_name ` | string | Reviewer name <i class =" label label-info " >read-only</i > |
2234
- | ` reviewer_email ` | string | Reviewer email <i class =" label label-info " >read-only</i > |
2235
- | ` verified ` | boolean | Shows if the reviewer bought the product or not <i class =" label label-info " >read-only</i > |
2379
+ ## Update A Product Attribute ##
2380
+
2381
+ This API lets you make changes to a product attribute.
2382
+
2383
+ ### HTTP Request ###
2384
+
2385
+ <div class =" api-endpoint " >
2386
+ <div class="endpoint-data">
2387
+ <i class="label label-put">PUT</i>
2388
+ <h6>/wc-api/v3/products/attributes/<id></h6>
2389
+ </div>
2390
+ </div >
2391
+
2392
+ ``` shell
2393
+ curl -X PUT https://example.com/wc-api/v3/products/attributes/1 \
2394
+ -u consumer_key:consumer_secret \
2395
+ -H " Content-Type: application/json" \
2396
+ -d ' {
2397
+ "product_attribute": {
2398
+ "order_by": "name"
2399
+ }
2400
+ }'
2401
+ ```
2402
+
2403
+ ``` javascript
2404
+ var data = {
2405
+ product_attribute: {
2406
+ order_by: ' name'
2407
+ }
2408
+ };
2409
+
2410
+ WooCommerce .put (' products/attributes/1' , data, function (err , data , res ) {
2411
+ console .log (res);
2412
+ });
2413
+ ```
2414
+
2415
+ ``` python
2416
+ data = {
2417
+ " product_attribute" : {
2418
+ " order_by" : " name"
2419
+ }
2420
+ }
2421
+
2422
+ print (wcapi.put(" products/attributes/1" , data).json())
2423
+ ```
2424
+
2425
+ ``` ruby
2426
+ data = {
2427
+ product_attribute: {
2428
+ order_by: " name"
2429
+ }
2430
+ }
2431
+
2432
+ woocommerce.put(" products/attributes/1" , data).parsed_response
2433
+ ```
2434
+
2435
+ > JSON response example:
2436
+
2437
+ ``` json
2438
+ {
2439
+ "product_attribute" : {
2440
+ "id" : 1 ,
2441
+ "name" : " Color" ,
2442
+ "slug" : " pa_color" ,
2443
+ "type" : " select" ,
2444
+ "order_by" : " name" ,
2445
+ "has_archives" : true
2446
+ }
2447
+ }
2448
+ ```
2449
+
2450
+ <aside class =" notice " >
2451
+ View the <a href="#product-attribute-properties">Product Attribute Properties</a> for more details on this response.
2452
+ </aside >
2453
+
2454
+ ## Delete A Product Attribute ##
2455
+
2456
+ This API helps you delete a product attribute.
2457
+
2458
+ ### HTTP Request ###
2459
+
2460
+ <div class =" api-endpoint " >
2461
+ <div class="endpoint-data">
2462
+ <i class="label label-delete">DELETE</i>
2463
+ <h6>/wc-api/v3/products/attributes/<id></h6>
2464
+ </div>
2465
+ </div >
2466
+
2467
+ ``` shell
2468
+ curl -X DELETE https://example.com/wc-api/v3/products/attributes/1 \
2469
+ -u consumer_key:consumer_secret
2470
+ ```
2471
+
2472
+ ``` javascript
2473
+ WooCommerce .delete (' products/attributes/1' , function (err , data , res ) {
2474
+ console .log (res);
2475
+ });
2476
+ ```
2477
+
2478
+ ``` python
2479
+ print (wcapi.delete(" products/attributes/1" ).json())
2480
+ ```
2481
+
2482
+ ``` ruby
2483
+ woocommerce.delete(" products/attributes/1" ).parsed_response
2484
+ ```
2485
+
2486
+ > JSON response example:
2487
+
2488
+ ``` json
2489
+ {
2490
+ "message" : " Deleted product_attribute"
2491
+ }
2492
+ ```
2236
2493
2237
2494
## View A Product Category ##
2238
2495
2496
+ This API lets you retrieve a product category.
2497
+
2239
2498
<div class =" api-endpoint " >
2240
2499
<div class="endpoint-data">
2241
2500
<i class="label label-get">GET</i>
@@ -2284,16 +2543,19 @@ woocommerce.get("products/categories/9").parsed_response
2284
2543
| Attribute | Type | Description |
2285
2544
| ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
2286
2545
| ` id ` | integer | Category ID (term ID) <i class =" label label-info " >read-only</i > |
2287
- | ` name ` | string | Category Name <i class =" label label-info " >read-only</i > |
2546
+ | ` name ` | string | Category name <i class =" label label-info " >read-only</i > |
2288
2547
| ` slug ` | string | Category slug <i class =" label label-info " >read-only</i > |
2289
2548
| ` parent ` | integer | Category parent <i class =" label label-info " >read-only</i > |
2290
2549
| ` description ` | string | Category description <i class =" label label-info " >read-only</i > |
2291
2550
| ` display ` | string | Category archive display type, the types available include: ` default ` , ` products ` , ` subcategories ` and ` both ` <i class =" label label-info " >read-only</i > |
2292
2551
| ` image ` | string | Category image URL <i class =" label label-info " >read-only</i > |
2293
2552
| ` count ` | boolean | Shows the quantity of products in this category <i class =" label label-info " >read-only</i > |
2294
2553
2554
+
2295
2555
## View List Of Product Categories ##
2296
2556
2557
+ This API lets you retrieve all product categories.
2558
+
2297
2559
<div class =" api-endpoint " >
2298
2560
<div class="endpoint-data">
2299
2561
<i class="label label-get">GET</i>
@@ -2405,6 +2667,8 @@ woocommerce.get("products/categories").parsed_response
2405
2667
2406
2668
## View List Of Product Orders ##
2407
2669
2670
+ This API lets you retrieve all product orders.
2671
+
2408
2672
<div class =" api-endpoint " >
2409
2673
<div class="endpoint-data">
2410
2674
<i class="label label-get">GET</i>
@@ -2743,3 +3007,71 @@ woocommerce.get("products/546/orders").parsed_response
2743
3007
<aside class =" notice " >
2744
3008
View the <a href="#orders-properties">Order Properties</a> for more details on this response.
2745
3009
</aside >
3010
+
3011
+ ## View List Of Product Reviews ##
3012
+
3013
+ This API lets you retrieve all reviews of a product.
3014
+
3015
+ <div class =" api-endpoint " >
3016
+ <div class="endpoint-data">
3017
+ <i class="label label-get">GET</i>
3018
+ <h6>/wc-api/v3/products/<id>/reviews</h6>
3019
+ </div>
3020
+ </div >
3021
+
3022
+ ``` shell
3023
+ curl https://example.com/wc-api/v3/products/546/reviews \
3024
+ -u consumer_key:consumer_secret
3025
+ ```
3026
+
3027
+ ``` javascript
3028
+ WooCommerce .get (' products/546/reviews' , function (err , data , res ) {
3029
+ console .log (res);
3030
+ });
3031
+ ```
3032
+
3033
+ ``` python
3034
+ print (wcapi.get(" products/546/reviews" ).json())
3035
+ ```
3036
+
3037
+ ``` ruby
3038
+ woocommerce.get(" products/546/reviews" ).parsed_response
3039
+ ```
3040
+
3041
+ > JSON response example:
3042
+
3043
+ ``` json
3044
+ {
3045
+ "product_reviews" : [
3046
+ {
3047
+ "id" : 4 ,
3048
+ "created_at" : " 2013-06-07T11:57:45Z" ,
3049
+ "review" : " This t-shirt is awesome! Would recommend to everyone!\n\n I'm ordering mine next week" ,
3050
+ "rating" : " 5" ,
3051
+ "reviewer_name" : " Andrew" ,
3052
+ "reviewer_email" : " andrew@example.com" ,
3053
+ "verified" : false
3054
+ },
3055
+ {
3056
+ "id" : 3 ,
3057
+ "created_at" : " 2013-06-07T11:53:49Z" ,
3058
+ "review" : " Wonderful quality, and an awesome design. WooThemes ftw!" ,
3059
+ "rating" : " 4" ,
3060
+ "reviewer_name" : " Cobus Bester" ,
3061
+ "reviewer_email" : " cobus@example.com" ,
3062
+ "verified" : false
3063
+ }
3064
+ ]
3065
+ }
3066
+ ```
3067
+
3068
+ ### Product Reviews Properties ###
3069
+
3070
+ | Attribute | Type | Description |
3071
+ | ---------------- | ------- | ----------------------------------------------------------------------------------------- |
3072
+ | ` id ` | integer | Review ID (comment ID) <i class =" label label-info " >read-only</i > |
3073
+ | ` created_at ` | string | UTC DateTime when the review was created <i class =" label label-info " >read-only</i > |
3074
+ | ` rating ` | string | Review rating (0 to 5) <i class =" label label-info " >read-only</i > |
3075
+ | ` reviewer_name ` | string | Reviewer name <i class =" label label-info " >read-only</i > |
3076
+ | ` reviewer_email ` | string | Reviewer email <i class =" label label-info " >read-only</i > |
3077
+ | ` verified ` | boolean | Shows if the reviewer bought the product or not <i class =" label label-info " >read-only</i > |
0 commit comments