Skip to content

Commit 9315664

Browse files
committed
Merge branch 'trunk' into update/for-enhancement-28132
2 parents 6cb00ae + 93f8685 commit 9315664

34 files changed

+1299
-240
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
run: ./build.sh
1616
- name: Deploy to GitHub Pages
1717
if: success()
18-
uses: crazy-max/ghaction-github-pages@v2
18+
uses: crazy-max/ghaction-github-pages@59173cb633d9a3514f5f4552a6a3e62c6710355c # v2
1919
env:
2020
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2121
with:

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@ This project is based on [Slate](https://github.com/tripit/slate).
66

77
## Usage ##
88

9-
To generate docs run:
9+
### Updating and building the docs
10+
11+
The docs for the latest version of the REST API (v3) are in `source/includes/wp-api-v3`. Each section of the docs has its own Markdown file. Once you have made changes, you can generate the docs locally with the following:
1012

1113
```bash
1214
./build.sh
1315
```
1416

15-
To deploy generated docs:
17+
After the build script has finished, the generated docs can be found in the `build` directory. Open the `index.html` file in your browser to view the local version of the docs site.
18+
19+
### Deploying the docs
20+
21+
When you merge a PR to the trunk branch of this repository, a workflow runs that will automatically deploy the generated docs to the `gh-pages` branch. However, you can also deploy manually with the following:
1622

1723
```bash
1824
./deploy.sh

source/images/favicon-180x180.png

12.5 KB
Loading

source/images/favicon-192x192.png

13.2 KB
Loading

source/images/favicon-270x270.png

18.9 KB
Loading

source/images/favicon-32x32.png

2.29 KB
Loading

source/images/logo.png

9.63 KB
Loading
-2.74 KB
Loading

source/includes/v3/_products.md

Lines changed: 120 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ This section lists all API endpoints that can be used to create, edit or otherwi
1616
| `downloadable` | boolean | If the product is downloadable or not. Downloadable products give access to a file upon purchase |
1717
| `virtual` | boolean | If the product is virtual or not. Virtual products are intangible and aren't shipped |
1818
| `permalink` | string | Product URL (post permalink) <i class="label label-info">read-only</i> |
19-
| `sku` | string | SKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased |
19+
| `sku` | string | SKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased
20+
| `global_unique_id` | string | GTIN, UPC, EAN or ISBN - a unique identifier for each distinct product and service that can be purchased|
2021
| `price` | string | Current product price. This is setted from `regular_price` and `sale_price` <i class="label label-info">read-only</i> |
2122
| `regular_price` | string | Product regular price |
2223
| `sale_price` | string | Product sale price |
@@ -57,6 +58,7 @@ This section lists all API endpoints that can be used to create, edit or otherwi
5758
| `parent_id` | integer | Product parent ID (post_parent) |
5859
| `categories` | array | List of product categories names (`string`). In write-mode need to pass a array of categories IDs (`integer`) ([uses wp_set_object_terms()](http://codex.wordpress.org/Function_Reference/wp_set_object_terms)) |
5960
| `tags` | array | List of product tags names (`string`). In write-mode need to pass a array of tags IDs (`integer`) ([uses wp_set_object_terms()](http://codex.wordpress.org/Function_Reference/wp_set_object_terms)) |
61+
| `brands` | array | List of product brands. See [Brands Properties](#brands-properties). In write-mode pass an array of brand objects with `id` property ([uses wp_set_object_terms()](http://codex.wordpress.org/Function_Reference/wp_set_object_terms)) |
6062
| `images` | array | List of products images. See [Images Properties](#images-properties) |
6163
| `featured_src` | string | Featured image URL <i class="label label-info">read-only</i> |
6264
| `attributes` | array | List of product attributes. See [Attributes Properties](#attributes-properties). Note: the attribute must be registered in WooCommerce before. |
@@ -102,6 +104,14 @@ This section lists all API endpoints that can be used to create, edit or otherwi
102104
<code>alt</code> and <code>title</code> attributes are writable starting from WooCommerce 2.5.
103105
</aside>
104106

107+
### Brands Properties ###
108+
109+
| Attribute | Type | Description |
110+
| --------- | ------- | -------------------------------------------------------------------------------------- |
111+
| `id` | integer | Brand ID <i class="label label-info">required for write operations</i> |
112+
| `name` | string | Brand name <i class="label label-info">read-only</i> |
113+
| `slug` | string | Brand slug <i class="label label-info">read-only</i> |
114+
105115
### Attributes Properties ###
106116

107117
| Attribute | Type | Description |
@@ -140,6 +150,7 @@ This section lists all API endpoints that can be used to create, edit or otherwi
140150
| `virtual` | boolean | If the variation is virtual or not. Virtual variations are intangible and aren't shipped |
141151
| `permalink` | string | Variation URL (post permalink) <i class="label label-info">read-only</i> |
142152
| `sku` | string | SKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased |
153+
| `global_unique_id` | string | GTIN, UPC, EAN or ISBN - a unique identifier for each distinct product and service that can be purchased |
143154
| `price` | string | Current variation price. This is setted from `regular_price` and `sale_price` <i class="label label-info">read-only</i> |
144155
| `regular_price` | string | Variation regular price |
145156
| `sale_price` | string | Variation sale price |
@@ -195,6 +206,14 @@ curl -X POST https://example.com/wc-api/v3/products \
195206
9,
196207
14
197208
],
209+
"brands": [
210+
{
211+
"id": 15
212+
},
213+
{
214+
"id": 16
215+
}
216+
],
198217
"images": [
199218
{
200219
"src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
@@ -221,6 +240,14 @@ var data = {
221240
9,
222241
14
223242
],
243+
brands: [
244+
{
245+
id: 15
246+
},
247+
{
248+
id: 16
249+
}
250+
],
224251
images: [
225252
{
226253
src: 'http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg',
@@ -252,6 +279,14 @@ $data = [
252279
9,
253280
14
254281
],
282+
'brands' => [
283+
[
284+
'id' => 15
285+
],
286+
[
287+
'id' => 16
288+
]
289+
],
255290
'images' => [
256291
[
257292
'src' => 'http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg',
@@ -281,6 +316,14 @@ data = {
281316
9,
282317
14
283318
],
319+
"brands": [
320+
{
321+
"id": 15
322+
},
323+
{
324+
"id": 16
325+
}
326+
],
284327
"images": [
285328
{
286329
"src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
@@ -309,6 +352,14 @@ data = {
309352
9,
310353
14
311354
],
355+
brands: [
356+
{
357+
id: 15
358+
},
359+
{
360+
id: 16
361+
}
362+
],
312363
images: [
313364
{
314365
src: "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
@@ -389,6 +440,13 @@ woocommerce.post("products", data).parsed_response
389440
"T-shirts"
390441
],
391442
"tags": [],
443+
"brands": [
444+
{
445+
"id": 99,
446+
"name": "Test",
447+
"slug": "test"
448+
}
449+
],
392450
"images": [
393451
{
394452
"id": 547,
@@ -441,6 +499,14 @@ curl -X POST https://example.com/wc-api/v3/products \
441499
9,
442500
14
443501
],
502+
"brands": [
503+
{
504+
"id": 15
505+
},
506+
{
507+
"id": 16
508+
}
509+
],
444510
"images": [
445511
{
446512
"src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
@@ -528,6 +594,14 @@ var data = {
528594
9,
529595
14
530596
],
597+
brands: [
598+
{
599+
id: 15
600+
},
601+
{
602+
id: 16
603+
}
604+
],
531605
images: [
532606
{
533607
src: 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg',
@@ -620,6 +694,14 @@ $data = [
620694
9,
621695
14
622696
],
697+
'brands' => [
698+
[
699+
'id' => 15
700+
],
701+
[
702+
'id' => 16
703+
]
704+
],
623705
'images' => [
624706
[
625707
'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg',
@@ -710,6 +792,14 @@ data = {
710792
9,
711793
14
712794
],
795+
"brands": [
796+
{
797+
"id": 15
798+
},
799+
{
800+
"id": 16
801+
}
802+
],
713803
"images": [
714804
{
715805
"src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
@@ -799,6 +889,14 @@ data = {
799889
9,
800890
14
801891
],
892+
brands: [
893+
{
894+
id: 15
895+
},
896+
{
897+
id: 16
898+
}
899+
],
802900
images: [
803901
{
804902
src: "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
@@ -941,6 +1039,13 @@ woocommerce.post("products", data).parsed_response
9411039
"T-shirts"
9421040
],
9431041
"tags": [],
1042+
"brands": [
1043+
{
1044+
"id": 99,
1045+
"name": "test",
1046+
"slug": "test"
1047+
}
1048+
],
9441049
"images": [
9451050
{
9461051
"id": 605,
@@ -1212,6 +1317,13 @@ woocommerce.get("products/546").parsed_response
12121317
"T-shirts"
12131318
],
12141319
"tags": [],
1320+
"brands": [
1321+
{
1322+
"id": 99,
1323+
"name": "test",
1324+
"slug": "test"
1325+
}
1326+
],
12151327
"images": [
12161328
{
12171329
"id": 547,
@@ -1761,6 +1873,13 @@ woocommerce.put("products/546", data).parsed_response
17611873
"T-shirts"
17621874
],
17631875
"tags": [],
1876+
"brands": [
1877+
{
1878+
"id": 99,
1879+
"name": "test",
1880+
"slug": "test"
1881+
}
1882+
],
17641883
"images": [
17651884
{
17661885
"id": 547,

source/includes/v3/_taxes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ curl -X POST https://example.com/wc-api/v3/taxes \
4242
"state": "AL",
4343
"rate": "4",
4444
"name": "State Tax",
45-
"shipping": false
45+
"shipping": false,
46+
"class": "standard"
4647
}
4748
}'
4849
```

0 commit comments

Comments
 (0)