├── source ├── javascripts │ ├── all.js │ ├── all_nosearch.js │ ├── app │ │ ├── _search.js │ │ ├── _toc.js │ │ └── _lang.js │ └── lib │ │ ├── _jquery.highlight.js │ │ ├── _energize.js │ │ └── _imagesloaded.min.js ├── fonts │ ├── slate.eot │ ├── slate.ttf │ ├── slate.woff │ ├── slate.woff2 │ └── slate.svg ├── images │ ├── logo.png │ ├── navbar.png │ ├── favicon-32x32.png │ ├── favicon-180x180.png │ ├── favicon-192x192.png │ ├── favicon-270x270.png │ ├── woocommerce-api-key-generated.png │ ├── woocommerce-api-keys-settings.png │ ├── woocommerce-creating-api-keys.png │ ├── woocommerce-auth-endpoint-flow.png │ └── woocommerce-auth-endpoint-example.png ├── stylesheets │ ├── _lang-selector.scss │ ├── _toc.scss │ ├── _content.scss │ ├── _label.scss │ ├── _warning.scss │ ├── _icon-font.scss │ ├── _api-endpoint.scss │ ├── print.css.scss │ ├── _rtl.scss │ └── _variables.scss ├── v1.html.md ├── v2.html.md ├── v3.html.md ├── wp-api-v1.html.md ├── wp-api-v2.html.md ├── index.html.md ├── includes │ ├── wp-api-v3 │ │ ├── _product-custom-fields.md │ │ ├── _shipping-methods.md │ │ ├── _shipping-zone-locations.md │ │ ├── _tax-classes.md │ │ ├── _refunds.md │ │ └── _order-actions.md │ ├── wp-api-v2 │ │ ├── _shipping-methods.md │ │ ├── _shipping-zone-locations.md │ │ └── _tax-classes.md │ ├── v3 │ │ ├── _tax-classes.md │ │ ├── _authentication-endpoint.md │ │ ├── _reports.md │ │ ├── _product-tags.md │ │ ├── _order-notes.md │ │ ├── _order-refunds.md │ │ ├── _product-attributes.md │ │ ├── _product-attribute-terms.md │ │ └── _product-shipping-classes.md │ ├── wp-api-v1 │ │ ├── _tax-classes.md │ │ └── _order-notes.md │ └── v2 │ │ └── _reports.md └── layouts │ └── layout.erb ├── .gitignore ├── .editorconfig ├── LICENSE ├── .github └── workflows │ └── deploy.yml ├── README.md ├── font-selection.json └── deploy.sh /source/javascripts/all.js: -------------------------------------------------------------------------------- 1 | //= require ./all_nosearch 2 | //= require ./app/_search 3 | -------------------------------------------------------------------------------- /source/fonts/slate.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woocommerce/woocommerce-rest-api-docs/HEAD/source/fonts/slate.eot -------------------------------------------------------------------------------- /source/fonts/slate.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woocommerce/woocommerce-rest-api-docs/HEAD/source/fonts/slate.ttf -------------------------------------------------------------------------------- /source/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woocommerce/woocommerce-rest-api-docs/HEAD/source/images/logo.png -------------------------------------------------------------------------------- /source/fonts/slate.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woocommerce/woocommerce-rest-api-docs/HEAD/source/fonts/slate.woff -------------------------------------------------------------------------------- /source/fonts/slate.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woocommerce/woocommerce-rest-api-docs/HEAD/source/fonts/slate.woff2 -------------------------------------------------------------------------------- /source/images/navbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woocommerce/woocommerce-rest-api-docs/HEAD/source/images/navbar.png -------------------------------------------------------------------------------- /source/images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woocommerce/woocommerce-rest-api-docs/HEAD/source/images/favicon-32x32.png -------------------------------------------------------------------------------- /source/images/favicon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woocommerce/woocommerce-rest-api-docs/HEAD/source/images/favicon-180x180.png -------------------------------------------------------------------------------- /source/images/favicon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woocommerce/woocommerce-rest-api-docs/HEAD/source/images/favicon-192x192.png -------------------------------------------------------------------------------- /source/images/favicon-270x270.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woocommerce/woocommerce-rest-api-docs/HEAD/source/images/favicon-270x270.png -------------------------------------------------------------------------------- /source/images/woocommerce-api-key-generated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woocommerce/woocommerce-rest-api-docs/HEAD/source/images/woocommerce-api-key-generated.png -------------------------------------------------------------------------------- /source/images/woocommerce-api-keys-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woocommerce/woocommerce-rest-api-docs/HEAD/source/images/woocommerce-api-keys-settings.png -------------------------------------------------------------------------------- /source/images/woocommerce-creating-api-keys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woocommerce/woocommerce-rest-api-docs/HEAD/source/images/woocommerce-creating-api-keys.png -------------------------------------------------------------------------------- /source/images/woocommerce-auth-endpoint-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woocommerce/woocommerce-rest-api-docs/HEAD/source/images/woocommerce-auth-endpoint-flow.png -------------------------------------------------------------------------------- /source/images/woocommerce-auth-endpoint-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woocommerce/woocommerce-rest-api-docs/HEAD/source/images/woocommerce-auth-endpoint-example.png -------------------------------------------------------------------------------- /source/stylesheets/_lang-selector.scss: -------------------------------------------------------------------------------- 1 | .lang-selector { 2 | a { 3 | border-top: 4px solid $lang-select-bg; 4 | padding: 10px 20px; 5 | 6 | &:active, &:focus, &:hover { 7 | border-top-color: #873EFF; 8 | } 9 | 10 | &.active { 11 | border-top-color: #873EFF; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | *.rbc 3 | .bundle 4 | .config 5 | coverage 6 | InstalledFiles 7 | lib/bundler/man 8 | pkg 9 | rdoc 10 | spec/reports 11 | test/tmp 12 | test/version_tmp 13 | tmp 14 | *.DS_STORE 15 | build/ 16 | .cache 17 | .vagrant 18 | .sass-cache 19 | 20 | # YARD artifacts 21 | .yardoc 22 | _yardoc 23 | doc/ 24 | .idea/ 25 | 26 | test.* 27 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # Top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | indent_style = space 11 | indent_size = 2 12 | trim_trailing_whitespace = true 13 | 14 | [*.rb] 15 | charset = utf-8 16 | 17 | [*.md] 18 | trim_trailing_whitespace = false 19 | -------------------------------------------------------------------------------- /source/javascripts/all_nosearch.js: -------------------------------------------------------------------------------- 1 | //= require ./lib/_energize 2 | //= require ./app/_toc 3 | //= require ./app/_lang 4 | 5 | $(function() { 6 | loadToc($('#toc'), '.toc-link', '.toc-list-h2', 10); 7 | setupLanguages($('body').data('languages')); 8 | $('.content').imagesLoaded( function() { 9 | window.recacheHeights(); 10 | window.refreshToc(); 11 | }); 12 | }); 13 | 14 | window.onpopstate = function() { 15 | activateLanguage(getLanguageFromQueryString()); 16 | }; 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008-2013 Concur Technologies, Inc. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | not use this file except in compliance with the License. You may obtain 5 | a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | License for the specific language governing permissions and limitations 13 | under the License. -------------------------------------------------------------------------------- /source/stylesheets/_toc.scss: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // WOOCOMMERCE CUSTOM TOC STYLES 3 | //////////////////////////////////////////////////////////////////////////////// 4 | 5 | .toc-wrapper { 6 | .toc-link:hover { 7 | background: #eee; 8 | } 9 | .toc-link.active-parent:hover { 10 | background: #eee; 11 | } 12 | .toc-link.active:hover { 13 | background: $nav-active-bg; 14 | } 15 | 16 | .toc-footer { 17 | border-top: 1px solid $nav-footer-border-color; 18 | } 19 | } 20 | 21 | .toc-link, .toc-footer li { 22 | padding: 3px $nav-padding; 23 | } 24 | -------------------------------------------------------------------------------- /source/stylesheets/_content.scss: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // CUSTOM CONTENT STYLES 3 | //////////////////////////////////////////////////////////////////////////////// 4 | .content { 5 | a { 6 | color: $link-color; 7 | text-decoration: none; 8 | 9 | &:hover { 10 | text-decoration: underline; 11 | } 12 | } 13 | 14 | h4, h5, h6 { 15 | font-size: 13px; 16 | } 17 | 18 | aside { 19 | color: #fff; 20 | 21 | a { 22 | color: #fff; 23 | text-decoration: underline; 24 | 25 | &:hover { 26 | text-decoration: none; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy on push 2 | on: 3 | push: 4 | branches: 5 | - trunk 6 | jobs: 7 | build-and-deploy: 8 | if: github.repository_owner == 'woocommerce' 9 | name: Build and deploy 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout code 13 | uses: actions/checkout@v2 14 | - name: Build 15 | run: ./build.sh 16 | - name: Deploy to GitHub Pages 17 | if: success() 18 | uses: crazy-max/ghaction-github-pages@59173cb633d9a3514f5f4552a6a3e62c6710355c # v2 19 | env: 20 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 21 | with: 22 | target_branch: gh-pages 23 | build_dir: build 24 | -------------------------------------------------------------------------------- /source/stylesheets/_label.scss: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // LABEL 3 | //////////////////////////////////////////////////////////////////////////////// 4 | .label { 5 | border-radius: 2px; 6 | text-transform: uppercase; 7 | font-style: normal; 8 | white-space: nowrap; 9 | } 10 | 11 | .label-get { 12 | background: #008000; 13 | } 14 | 15 | .label-post, 16 | .label-put { 17 | background: #4e92d7; 18 | } 19 | 20 | .label-delete { 21 | background: #ca4949; 22 | } 23 | 24 | .label-info { 25 | background: #efefef; 26 | color: #999; 27 | float: right; 28 | font-weight: 700; 29 | font-size: 70%; 30 | padding: 2px 4px; 31 | margin-left: 5px; 32 | } -------------------------------------------------------------------------------- /source/stylesheets/_warning.scss: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // PAGE WARNING 3 | //////////////////////////////////////////////////////////////////////////////// 4 | 5 | #warning-top { 6 | text-shadow: 0 1px 0 lighten($aside-warning-bg, 5%); 7 | box-shadow: 0 0 5px black; 8 | font-weight: bold; 9 | left: 0; 10 | line-height: 2.5; 11 | overflow: hidden; 12 | position: fixed; 13 | right: 0; 14 | text-align: center; 15 | top: 0; 16 | z-index: 99999; 17 | background-color: $aside-warning-bg; 18 | color: lighten($aside-notice-bg, 80%); 19 | 20 | a { 21 | color: lighten($aside-notice-bg, 80%); 22 | text-decoration: underline; 23 | } 24 | 25 | .info:before { 26 | @extend %icon-exclamation-sign; 27 | font-size: 14px; 28 | padding-right: 0.5em; 29 | vertical-align: middle; 30 | } 31 | } -------------------------------------------------------------------------------- /source/stylesheets/_icon-font.scss: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'slate'; 3 | src:font-url('slate.eot?-syv14m'); 4 | src:font-url('slate.eot?#iefix-syv14m') format('embedded-opentype'), 5 | font-url('slate.woff2?-syv14m') format('woff2'), 6 | font-url('slate.woff?-syv14m') format('woff'), 7 | font-url('slate.ttf?-syv14m') format('truetype'), 8 | font-url('slate.svg?-syv14m#slate') format('svg'); 9 | font-weight: normal; 10 | font-style: normal; 11 | } 12 | 13 | %icon { 14 | font-family: 'slate'; 15 | speak: none; 16 | font-style: normal; 17 | font-weight: normal; 18 | font-variant: normal; 19 | text-transform: none; 20 | line-height: 1; 21 | } 22 | 23 | %icon-exclamation-sign { 24 | @extend %icon; 25 | content: "\e600"; 26 | } 27 | %icon-info-sign { 28 | @extend %icon; 29 | content: "\e602"; 30 | } 31 | %icon-ok-sign { 32 | @extend %icon; 33 | content: "\e606"; 34 | } 35 | %icon-search { 36 | @extend %icon; 37 | content: "\e607"; 38 | } 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WooCommerce REST API Docs # 2 | 3 | Repository of documentation REST API WooCommerce. 4 | 5 | This project is based on [Slate](https://github.com/tripit/slate). 6 | 7 | ## Usage ## 8 | 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: 12 | 13 | ```bash 14 | ./build.sh 15 | ``` 16 | 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: 22 | 23 | ```bash 24 | ./deploy.sh 25 | ``` 26 | -------------------------------------------------------------------------------- /source/stylesheets/_api-endpoint.scss: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | // API ENDPOINT 3 | //////////////////////////////////////////////////////////////////////////////// 4 | .api-endpoint { 5 | margin-right: $examples-width; 6 | padding: 0 $main-padding; 7 | box-sizing: border-box; 8 | display: block; 9 | @extend %left-col; 10 | 11 | .endpoint-data { 12 | background-color: $code-bg; 13 | color: #fff; 14 | border-radius: 5px; 15 | border-top: 1px solid #000; 16 | border-bottom: 1px solid #404040; 17 | text-shadow: 0px 1px 2px rgba(0,0,0,0.4); 18 | margin: 15px 0; 19 | height: 38px; 20 | 21 | i { 22 | display: inline-block; 23 | margin: 5px; 24 | padding: 4px 12px; 25 | line-height: 20px; 26 | } 27 | 28 | h6 { 29 | display: inline-block; 30 | margin: 0; 31 | @extend %code-font; 32 | text-transform: lowercase; 33 | font-weight: 400; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /source/v1.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: WooCommerce REST API Documentation v1 3 | 4 | language_tabs: 5 | - shell: cURL 6 | 7 | toc_footers: 8 | - Contributing to WC REST API Docs 9 | - REST API Source on GitHub 10 | - REST API Issues 11 | - WooCommerce Documentation 12 | - WooCommerce Repository 13 | - Documentation Powered by Slate 14 | 15 | includes: 16 | - v1/docs 17 | 18 | search: false 19 | 20 | warning: This documentation is for the WooCommerce API v1 which is now deprecated. Please use the latest REST API version. 21 | --- 22 | -------------------------------------------------------------------------------- /source/v2.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: WooCommerce REST API Documentation v2 3 | 4 | language_tabs: 5 | - shell: cURL 6 | - javascript: Node.js 7 | - python: Python 8 | - php: PHP 9 | - ruby: Ruby 10 | 11 | toc_footers: 12 | - Contributing to WC REST API Docs 13 | - REST API Source on GitHub 14 | - REST API Issues 15 | - WooCommerce Documentation 16 | - WooCommerce Repository 17 | - Documentation Powered by Slate 18 | 19 | includes: 20 | - v2/introduction 21 | - v2/index 22 | - v2/coupons 23 | - v2/customers 24 | - v2/orders 25 | - v2/products 26 | - v2/reports 27 | - v2/webhooks 28 | 29 | search: false 30 | 31 | warning: This documentation is for the WooCommerce API v2 which is now deprecated. Please use the latest REST API version. 32 | --- 33 | -------------------------------------------------------------------------------- /source/v3.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: WooCommerce REST API Documentation v3 3 | 4 | language_tabs: 5 | - shell: cURL 6 | - javascript: Node.js 7 | - php: PHP 8 | - python: Python 9 | - ruby: Ruby 10 | 11 | toc_footers: 12 | - Contributing to WC REST API Docs 13 | - REST API Source on GitHub 14 | - REST API Issues 15 | - WooCommerce Documentation 16 | - WooCommerce Repository 17 | - Documentation Powered by Slate 18 | 19 | includes: 20 | - v3/introduction 21 | - v3/index 22 | - v3/coupons 23 | - v3/customers 24 | - v3/orders 25 | - v3/order-notes 26 | - v3/order-refunds 27 | - v3/products 28 | - v3/product-attributes 29 | - v3/product-attribute-terms 30 | - v3/product-categories 31 | - v3/product-shipping-classes 32 | - v3/product-tags 33 | - v3/reports 34 | - v3/taxes 35 | - v3/tax-classes 36 | - v3/webhooks 37 | - v3/authentication-endpoint 38 | 39 | search: false 40 | 41 | warning: This documentation is for the WooCommerce API v3 API which is now deprecated. Please use the latest REST API version. 42 | --- 43 | -------------------------------------------------------------------------------- /source/wp-api-v1.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: WooCommerce REST API Documentation - WP REST API v1 3 | 4 | language_tabs: 5 | - shell: cURL 6 | - javascript: Node.js 7 | - php: PHP 8 | - python: Python 9 | - ruby: Ruby 10 | 11 | toc_footers: 12 | - Contributing to WC REST API Docs 13 | - REST API Source on GitHub 14 | - REST API Issues 15 | - WooCommerce Documentation 16 | - WooCommerce Repository 17 | - Documentation Powered by Slate 18 | 19 | includes: 20 | - wp-api-v1/introduction 21 | - wp-api-v1/authentication 22 | - wp-api-v1/index 23 | - wp-api-v1/coupons 24 | - wp-api-v1/customers 25 | - wp-api-v1/orders 26 | - wp-api-v1/order-notes 27 | - wp-api-v1/order-refunds 28 | - wp-api-v1/products 29 | - wp-api-v1/product-attributes 30 | - wp-api-v1/product-attribute-terms 31 | - wp-api-v1/product-categories 32 | - wp-api-v1/product-shipping-classes 33 | - wp-api-v1/product-tags 34 | - wp-api-v1/reports 35 | - wp-api-v1/taxes 36 | - wp-api-v1/tax-classes 37 | - wp-api-v1/webhooks 38 | 39 | search: false 40 | 41 | warning: This documentation is for the WooCommerce REST API v1 which is deprecated since WooCommerce 3.0. Please use the latest REST API version. 42 | --- 43 | -------------------------------------------------------------------------------- /source/wp-api-v2.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: WooCommerce REST API Documentation - WP REST API v2 3 | 4 | language_tabs: 5 | - shell: cURL 6 | - javascript: Node.js 7 | - php: PHP 8 | - python: Python 9 | - ruby: Ruby 10 | 11 | toc_footers: 12 | - Contributing to WC REST API Docs 13 | - REST API Source on GitHub 14 | - REST API Issues 15 | - WooCommerce Documentation 16 | - WooCommerce Repository 17 | - Documentation Powered by Slate 18 | 19 | includes: 20 | - wp-api-v2/introduction 21 | - wp-api-v2/authentication 22 | - wp-api-v2/index 23 | - wp-api-v2/coupons 24 | - wp-api-v2/customers 25 | - wp-api-v2/orders 26 | - wp-api-v2/order-notes 27 | - wp-api-v2/order-refunds 28 | - wp-api-v2/products 29 | - wp-api-v2/product-variations 30 | - wp-api-v2/product-attributes 31 | - wp-api-v2/product-attribute-terms 32 | - wp-api-v2/product-categories 33 | - wp-api-v2/product-shipping-classes 34 | - wp-api-v2/product-tags 35 | - wp-api-v2/reports 36 | - wp-api-v2/taxes 37 | - wp-api-v2/tax-classes 38 | - wp-api-v2/webhooks 39 | - wp-api-v2/settings 40 | - wp-api-v2/setting-options 41 | - wp-api-v2/payment-gateways 42 | - wp-api-v2/shipping-zones 43 | - wp-api-v2/shipping-zone-locations 44 | - wp-api-v2/shipping-zone-methods 45 | - wp-api-v2/shipping-methods 46 | - wp-api-v2/system-status 47 | - wp-api-v2/system-status-tools 48 | 49 | search: false 50 | --- 51 | -------------------------------------------------------------------------------- /source/index.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: WooCommerce REST API Documentation - WP REST API v3 3 | 4 | language_tabs: 5 | - shell: cURL 6 | - javascript: Node.js 7 | - php: PHP 8 | - python: Python 9 | - ruby: Ruby 10 | 11 | toc_footers: 12 | - We're hiring! 13 | - Contributing to WC REST API Docs 14 | - REST API Source on GitHub 15 | - REST API Issues 16 | - WooCommerce Documentation 17 | - WooCommerce Repository 18 | - Documentation Powered by Slate 19 | 20 | includes: 21 | - wp-api-v3/introduction 22 | - wp-api-v3/authentication 23 | - wp-api-v3/index 24 | - wp-api-v3/coupons 25 | - wp-api-v3/customers 26 | - wp-api-v3/orders 27 | - wp-api-v3/order-actions 28 | - wp-api-v3/order-notes 29 | - wp-api-v3/order-refunds 30 | - wp-api-v3/products 31 | - wp-api-v3/product-variations 32 | - wp-api-v3/product-attributes 33 | - wp-api-v3/product-attribute-terms 34 | - wp-api-v3/product-categories 35 | - wp-api-v3/product-custom-fields 36 | - wp-api-v3/product-shipping-classes 37 | - wp-api-v3/product-tags 38 | - wp-api-v3/product-reviews 39 | - wp-api-v3/reports 40 | - wp-api-v3/refunds 41 | - wp-api-v3/taxes 42 | - wp-api-v3/tax-classes 43 | - wp-api-v3/webhooks 44 | - wp-api-v3/settings 45 | - wp-api-v3/setting-options 46 | - wp-api-v3/payment-gateways 47 | - wp-api-v3/shipping-zones 48 | - wp-api-v3/shipping-zone-locations 49 | - wp-api-v3/shipping-zone-methods 50 | - wp-api-v3/shipping-methods 51 | - wp-api-v3/system-status 52 | - wp-api-v3/system-status-tools 53 | - wp-api-v3/data 54 | 55 | search: false 56 | --- 57 | -------------------------------------------------------------------------------- /source/includes/wp-api-v3/_product-custom-fields.md: -------------------------------------------------------------------------------- 1 | # Product custom fields # 2 | 3 | The product custom fields API allows you to view the custom field names that have been recorded. 4 | 5 | ## Custom fields available parameters ## 6 | 7 | | Parameter | Type | Description | 8 | | ---------- | -------- | ---------------------------------------------------------------------------------------------------------------------------- | 9 | | `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. | 10 | | `page` | integer | Current page of the collection. Default is `1`. | 11 | | `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. | 12 | | `search` | string | Limit results to those matching a string. | 13 | | `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. | 14 | 15 | ## Retrieve product custom field names ## 16 | 17 | This API lets you retrieve filtered custom field names. 18 | 19 |
20 |
21 | GET 22 |
/wp-json/wc/v3/products/custom-fields/names
23 |
24 |
25 | 26 | ```shell 27 | curl https://example.com/wp-json/wc/v3/products/custom-fields/names \ 28 | -u consumer_key:consumer_secret 29 | ``` 30 | 31 | ```javascript 32 | WooCommerce.get("products/custom-fields/names") 33 | .then((response) => { 34 | console.log(response.data); 35 | }) 36 | .catch((error) => { 37 | console.log(error.response.data); 38 | }); 39 | ``` 40 | 41 | ```php 42 | get('products/custom-fields/names')); ?> 43 | ``` 44 | 45 | ```python 46 | print(wcapi.get("products/custom-fields/names").json()) 47 | ``` 48 | 49 | ```ruby 50 | woocommerce.get("products/custom-fields/names").parsed_response 51 | ``` 52 | 53 | > JSON response example: 54 | 55 | ```json 56 | { 57 | [ 58 | "Custom field 1", 59 | "Custom field 2", 60 | "Custom field 3", 61 | "Custom field 4" 62 | ] 63 | } 64 | ``` 65 | -------------------------------------------------------------------------------- /source/javascripts/app/_search.js: -------------------------------------------------------------------------------- 1 | //= require ../lib/_lunr 2 | //= require ../lib/_jquery 3 | //= require ../lib/_jquery.highlight 4 | ;(function () { 5 | 'use strict'; 6 | 7 | var content, searchResults; 8 | var highlightOpts = { element: 'span', className: 'search-highlight' }; 9 | var searchDelay = 0; 10 | var timeoutHandle = 0; 11 | 12 | var index = new lunr.Index(); 13 | 14 | index.ref('id'); 15 | index.field('title', { boost: 10 }); 16 | index.field('body'); 17 | index.pipeline.add(lunr.trimmer, lunr.stopWordFilter); 18 | 19 | $(populate); 20 | $(bind); 21 | 22 | function populate() { 23 | $('h1, h2').each(function() { 24 | var title = $(this); 25 | var body = title.nextUntil('h1, h2'); 26 | index.add({ 27 | id: title.prop('id'), 28 | title: title.text(), 29 | body: body.text() 30 | }); 31 | }); 32 | 33 | determineSearchDelay(); 34 | } 35 | function determineSearchDelay() { 36 | if(index.tokenStore.length>5000) { 37 | searchDelay = 300; 38 | } 39 | } 40 | 41 | function bind() { 42 | content = $('.content'); 43 | searchResults = $('.search-results'); 44 | 45 | $('#input-search').on('keyup',function(e) { 46 | var wait = function() { 47 | return function(executingFunction, waitTime){ 48 | clearTimeout(timeoutHandle); 49 | timeoutHandle = setTimeout(executingFunction, waitTime); 50 | }; 51 | }(); 52 | wait(function(){ 53 | search(e); 54 | }, searchDelay ); 55 | }); 56 | } 57 | 58 | function search(event) { 59 | 60 | var searchInput = $('#input-search')[0]; 61 | 62 | unhighlight(); 63 | searchResults.addClass('visible'); 64 | 65 | // ESC clears the field 66 | if (event.keyCode === 27) searchInput.value = ''; 67 | 68 | if (searchInput.value) { 69 | var results = index.search(searchInput.value).filter(function(r) { 70 | return r.score > 0.0001; 71 | }); 72 | 73 | if (results.length) { 74 | searchResults.empty(); 75 | $.each(results, function (index, result) { 76 | var elem = document.getElementById(result.ref); 77 | searchResults.append("
  • " + $(elem).text() + "
  • "); 78 | }); 79 | highlight.call(searchInput); 80 | } else { 81 | searchResults.html('
  • '); 82 | $('.search-results li').text('No Results Found for "' + searchInput.value + '"'); 83 | } 84 | } else { 85 | unhighlight(); 86 | searchResults.removeClass('visible'); 87 | } 88 | } 89 | 90 | function highlight() { 91 | if (this.value) content.highlight(this.value, highlightOpts); 92 | } 93 | 94 | function unhighlight() { 95 | content.unhighlight(highlightOpts); 96 | } 97 | })(); 98 | 99 | -------------------------------------------------------------------------------- /source/fonts/slate.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by IcoMoon 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /source/stylesheets/print.css.scss: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | @import 'normalize'; 3 | @import 'variables'; 4 | @import 'icon-font'; 5 | 6 | /* 7 | Copyright 2008-2013 Concur Technologies, Inc. 8 | 9 | Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | not use this file except in compliance with the License. You may obtain 11 | a copy of the License at 12 | 13 | http://www.apache.org/licenses/LICENSE-2.0 14 | 15 | Unless required by applicable law or agreed to in writing, software 16 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 18 | License for the specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | $print-color: #999; 23 | $print-color-light: #ccc; 24 | $print-font-size: 12px; 25 | 26 | body { 27 | @extend %default-font; 28 | } 29 | 30 | .tocify, .toc-footer, .lang-selector, .search, #nav-button { 31 | display: none; 32 | } 33 | 34 | .tocify-wrapper>img { 35 | margin: 0 auto; 36 | display: block; 37 | } 38 | 39 | .content { 40 | font-size: 12px; 41 | 42 | pre, code { 43 | @extend %code-font; 44 | @extend %break-words; 45 | border: 1px solid $print-color; 46 | border-radius: 5px; 47 | font-size: 0.8em; 48 | } 49 | 50 | pre { 51 | code { 52 | border: 0; 53 | } 54 | } 55 | 56 | pre { 57 | padding: 1.3em; 58 | } 59 | 60 | code { 61 | padding: 0.2em; 62 | } 63 | 64 | table { 65 | border: 1px solid $print-color; 66 | tr { 67 | border-bottom: 1px solid $print-color; 68 | } 69 | td,th { 70 | padding: 0.7em; 71 | } 72 | } 73 | 74 | p { 75 | line-height: 1.5; 76 | } 77 | 78 | a { 79 | text-decoration: none; 80 | color: #000; 81 | } 82 | 83 | h1 { 84 | @extend %header-font; 85 | font-size: 2.5em; 86 | padding-top: 0.5em; 87 | padding-bottom: 0.5em; 88 | margin-top: 1em; 89 | margin-bottom: $h1-margin-bottom; 90 | border: 2px solid $print-color-light; 91 | border-width: 2px 0; 92 | text-align: center; 93 | } 94 | 95 | h2 { 96 | @extend %header-font; 97 | font-size: 1.8em; 98 | margin-top: 2em; 99 | border-top: 2px solid $print-color-light; 100 | padding-top: 0.8em; 101 | } 102 | 103 | h1+h2, h1+div+h2 { 104 | border-top: none; 105 | padding-top: 0; 106 | margin-top: 0; 107 | } 108 | 109 | h3, h4 { 110 | @extend %header-font; 111 | font-size: 0.8em; 112 | margin-top: 1.5em; 113 | margin-bottom: 0.8em; 114 | text-transform: uppercase; 115 | } 116 | 117 | h5, h6 { 118 | text-transform: uppercase; 119 | } 120 | 121 | aside { 122 | padding: 1em; 123 | border: 1px solid $print-color-light; 124 | border-radius: 5px; 125 | margin-top: 1.5em; 126 | margin-bottom: 1.5em; 127 | line-height: 1.6; 128 | } 129 | 130 | aside:before { 131 | vertical-align: middle; 132 | padding-right: 0.5em; 133 | font-size: 14px; 134 | } 135 | 136 | aside.notice:before { 137 | @extend %icon-info-sign; 138 | } 139 | 140 | aside.warning:before { 141 | @extend %icon-exclamation-sign; 142 | } 143 | 144 | aside.success:before { 145 | @extend %icon-ok-sign; 146 | } 147 | } -------------------------------------------------------------------------------- /source/stylesheets/_rtl.scss: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // RTL Styles Variables 3 | //////////////////////////////////////////////////////////////////////////////// 4 | 5 | $default: auto; 6 | 7 | //////////////////////////////////////////////////////////////////////////////// 8 | // TABLE OF CONTENTS 9 | //////////////////////////////////////////////////////////////////////////////// 10 | 11 | #toc>ul>li>a>span { 12 | float: left; 13 | } 14 | 15 | .toc-wrapper { 16 | transition: right 0.3s ease-in-out !important; 17 | left: $default !important; 18 | #{right}: 0; 19 | } 20 | 21 | .toc-h2 { 22 | padding-#{right}: $nav-padding + $nav-indent; 23 | } 24 | 25 | #nav-button { 26 | #{right}: 0; 27 | transition: right 0.3s ease-in-out; 28 | &.open { 29 | right: $nav-width 30 | } 31 | } 32 | 33 | //////////////////////////////////////////////////////////////////////////////// 34 | // PAGE LAYOUT AND CODE SAMPLE BACKGROUND 35 | //////////////////////////////////////////////////////////////////////////////// 36 | .page-wrapper { 37 | margin-#{left}: $default !important; 38 | margin-#{right}: $nav-width; 39 | .dark-box { 40 | #{right}: $default; 41 | #{left}: 0; 42 | } 43 | } 44 | 45 | .lang-selector { 46 | width: $default !important; 47 | a { 48 | float: right; 49 | } 50 | } 51 | 52 | //////////////////////////////////////////////////////////////////////////////// 53 | // CODE SAMPLE STYLES 54 | //////////////////////////////////////////////////////////////////////////////// 55 | .content { 56 | &>h1, 57 | &>h2, 58 | &>h3, 59 | &>h4, 60 | &>h5, 61 | &>h6, 62 | &>p, 63 | &>table, 64 | &>ul, 65 | &>ol, 66 | &>aside, 67 | &>dl { 68 | margin-#{left}: $examples-width; 69 | margin-#{right}: $default !important; 70 | } 71 | &>ul, 72 | &>ol { 73 | padding-#{right}: $main-padding + 15px; 74 | } 75 | table { 76 | th, 77 | td { 78 | text-align: right; 79 | } 80 | } 81 | dd { 82 | margin-#{right}: 15px; 83 | } 84 | aside { 85 | aside:before { 86 | padding-#{left}: 0.5em; 87 | } 88 | .search-highlight { 89 | background: linear-gradient(to top right, #F7E633 0%, #F1D32F 100%); 90 | } 91 | } 92 | pre, 93 | blockquote { 94 | float: left !important; 95 | clear: left !important; 96 | } 97 | } 98 | 99 | //////////////////////////////////////////////////////////////////////////////// 100 | // TYPOGRAPHY 101 | //////////////////////////////////////////////////////////////////////////////// 102 | h1, 103 | h2, 104 | h3, 105 | h4, 106 | h5, 107 | h6, 108 | p, 109 | aside { 110 | text-align: right; 111 | direction: rtl; 112 | } 113 | 114 | .toc-wrapper { 115 | text-align: right; 116 | direction: rtl; 117 | font-weight: 100 !important; 118 | } 119 | 120 | 121 | //////////////////////////////////////////////////////////////////////////////// 122 | // RESPONSIVE DESIGN 123 | //////////////////////////////////////////////////////////////////////////////// 124 | @media (max-width: $tablet-width) { 125 | .toc-wrapper { 126 | #{right}: -$nav-width; 127 | &.open { 128 | #{right}: 0; 129 | } 130 | } 131 | .page-wrapper { 132 | margin-#{right}: 0; 133 | } 134 | } 135 | 136 | @media (max-width: $phone-width) { 137 | %left-col { 138 | margin-#{left}: 0; 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /source/stylesheets/_variables.scss: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2008-2013 Concur Technologies, Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | not use this file except in compliance with the License. You may obtain 6 | a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | License for the specific language governing permissions and limitations 14 | under the License. 15 | */ 16 | 17 | 18 | //////////////////////////////////////////////////////////////////////////////// 19 | // CUSTOMIZE SLATE 20 | //////////////////////////////////////////////////////////////////////////////// 21 | // Use these settings to help adjust the appearance of Slate 22 | 23 | 24 | // BACKGROUND COLORS 25 | //////////////////// 26 | $nav-bg: #f7f7f7 !default; 27 | $examples-bg: #393939 !default; 28 | $code-bg: #292929 !default; 29 | $code-annotation-bg: #191D1F !default; 30 | $nav-subitem-bg: #f7f7f7 !default; 31 | $nav-active-bg: #6108CE !default; 32 | $nav-active-parent-bg: #f7f7f7 !default; // parent links of the current section 33 | $lang-select-border: #000 !default; 34 | $lang-select-bg: #222 !default; 35 | $lang-select-active-bg: $examples-bg !default; // feel free to change this to blue or something 36 | $lang-select-pressed-bg: #111 !default; // color of language tab bg when mouse is pressed 37 | $main-bg: #ffffff !default; 38 | $aside-notice-bg: #6108CE !default; 39 | $aside-warning-bg: #ca4949 !default; 40 | $aside-success-bg: #38a845 !default; 41 | $search-notice-bg: #c97a7e !default; 42 | $link-color: #6108CE; 43 | 44 | 45 | // TEXT COLORS 46 | //////////////////// 47 | $main-text: #333 !default; // main content text color 48 | $nav-text: #3c3c3c !default; 49 | $nav-active-text: #fff !default; 50 | $nav-active-parent-text: #3c3c3c !default; // parent links of the current section 51 | $lang-select-text: #fff !default; // color of unselected language tab text 52 | $lang-select-active-text: #fff !default; // color of selected language tab text 53 | $lang-select-pressed-text: #fff !default; // color of language tab text when mouse is pressed 54 | 55 | 56 | // SIZES 57 | //////////////////// 58 | $nav-width: 230px !default; // width of the navbar 59 | $examples-width: 50% !default; // portion of the screen taken up by code examples 60 | $logo-margin: 20px !default; // margin below logo 61 | $main-padding: 28px !default; // padding to left and right of content & examples 62 | $nav-padding: 20px !default; // padding to left and right of navbar 63 | $nav-v-padding: 10px !default; // padding used vertically around search boxes and results 64 | $nav-indent: 10px !default; // extra padding for ToC subitems 65 | $code-annotation-padding: 13px !default; // padding inside code annotations 66 | $h1-margin-bottom: 21px !default; // padding under the largest header tags 67 | $tablet-width: 930px !default; // min width before reverting to tablet size 68 | $phone-width: $tablet-width - $nav-width !default; // min width before reverting to mobile size 69 | 70 | // FONTS 71 | //////////////////// 72 | %default-font { 73 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; 74 | font-size: 14px; 75 | } 76 | 77 | %header-font { 78 | @extend %default-font; 79 | font-weight: bold; 80 | } 81 | 82 | %code-font { 83 | font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, serif; 84 | font-size: 12px; 85 | line-height: 1.5; 86 | } 87 | 88 | 89 | // OTHER 90 | //////////////////// 91 | $nav-footer-border-color: #ddd !default; 92 | $search-box-border-color: #666 !default; 93 | 94 | //////////////////////////////////////////////////////////////////////////////// 95 | // INTERNAL 96 | //////////////////////////////////////////////////////////////////////////////// 97 | // These settings are probably best left alone. 98 | 99 | %break-words { 100 | word-break: break-all; 101 | hyphens: auto; 102 | } 103 | -------------------------------------------------------------------------------- /source/javascripts/app/_toc.js: -------------------------------------------------------------------------------- 1 | //= require ../lib/_jquery 2 | //= require ../lib/_imagesloaded.min 3 | ;(function () { 4 | 'use strict'; 5 | 6 | var htmlPattern = /<[^>]*>/g; 7 | var loaded = false; 8 | 9 | var debounce = function(func, waitTime) { 10 | var timeout = false; 11 | return function() { 12 | if (timeout === false) { 13 | setTimeout(function() { 14 | func(); 15 | timeout = false; 16 | }, waitTime); 17 | timeout = true; 18 | } 19 | }; 20 | }; 21 | 22 | var closeToc = function() { 23 | $(".toc-wrapper").removeClass('open'); 24 | $("#nav-button").removeClass('open'); 25 | }; 26 | 27 | function loadToc($toc, tocLinkSelector, tocListSelector, scrollOffset) { 28 | var headerHeights = {}; 29 | var pageHeight = 0; 30 | var windowHeight = 0; 31 | var originalTitle = document.title; 32 | 33 | var recacheHeights = function() { 34 | headerHeights = {}; 35 | pageHeight = $(document).height(); 36 | windowHeight = $(window).height(); 37 | 38 | $toc.find(tocLinkSelector).each(function() { 39 | var targetId = $(this).attr('href'); 40 | if (targetId[0] === "#") { 41 | headerHeights[targetId] = $(targetId).offset().top; 42 | } 43 | }); 44 | }; 45 | 46 | var refreshToc = function() { 47 | var currentTop = $(document).scrollTop() + scrollOffset; 48 | 49 | if (currentTop + windowHeight >= pageHeight) { 50 | // at bottom of page, so just select last header by making currentTop very large 51 | // this fixes the problem where the last header won't ever show as active if its content 52 | // is shorter than the window height 53 | currentTop = pageHeight + 1000; 54 | } 55 | 56 | var best = null; 57 | for (var name in headerHeights) { 58 | if ((headerHeights[name] < currentTop && headerHeights[name] > headerHeights[best]) || best === null) { 59 | best = name; 60 | } 61 | } 62 | 63 | // Catch the initial load case 64 | if (currentTop == scrollOffset && !loaded) { 65 | best = window.location.hash; 66 | loaded = true; 67 | } 68 | 69 | var $best = $toc.find("[href='" + best + "']").first(); 70 | if (!$best.hasClass("active")) { 71 | // .active is applied to the ToC link we're currently on, and its parent