### PHP WooCommerce REST API Setup Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/includes/wp-api-v3/_introduction.md Setup instructions for the PHP client library, including installation via Composer and initialization with store credentials. ```php true, // Enable the WP REST API integration 'version' => 'wc/v3' // WooCommerce WP REST API version ] ); ?> ``` -------------------------------- ### Python WooCommerce REST API Setup Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/includes/wp-api-v3/_introduction.md Setup instructions for the Python client library, including installation via pip and initialization with store credentials. ```python # Install: # pip install woocommerce # Setup: from woocommerce import API wcapi = API( url="http://example.com", # Your store URL consumer_key="consumer_key", # Your consumer key consumer_secret="consumer_secret", # Your consumer secret wp_api=True, # Enable the WP REST API integration version="wc/v3" # WooCommerce WP REST API version ) ``` -------------------------------- ### JavaScript WooCommerce REST API Setup Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/includes/wp-api-v3/_introduction.md Setup instructions for the JavaScript client library, including installation and initialization with store credentials. ```javascript // Install: // npm install --save @woocommerce/woocommerce-rest-api // Setup: const WooCommerceRestApi = require("@woocommerce/woocommerce-rest-api").default; // import WooCommerceRestApi from "@woocommerce/woocommerce-rest-api"; // Supports ESM const WooCommerce = new WooCommerceRestApi({ url: 'http://example.com', // Your store URL consumerKey: 'consumer_key', // Your consumer key consumerSecret: 'consumer_secret', // Your consumer secret version: 'wc/v3' // WooCommerce WP REST API version }); ``` -------------------------------- ### Example Product Creation Response Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/includes/wp-api-v3/_products.md This is an example of the JSON response received after successfully creating a product via the API. ```json { "create": [ { "id": 801, "name": "Woo Single #1", "slug": "woo-single-1-4", "permalink": "https://example.com/product/woo-single-1-4/", "date_created": "2017-03-23T17:35:43", "date_created_gmt": "2017-03-23T20:35:43", "date_modified": "2017-03-23T17:35:43", "date_modified_gmt": "2017-03-23T20:35:43", "type": "simple", "status": "publish", "featured": false, "catalog_visibility": "visible", "description": "", "short_description": "", "sku": "", "price": "21.99", "regular_price": "21.99", "sale_price": "", "date_on_sale_from": null, "date_on_sale_from_gmt": null, "date_on_sale_to": null, "date_on_sale_to_gmt": null, "price_html": "21.99", "on_sale": false, "purchasable": true, "total_sales": 0, "virtual": true, "downloadable": true, "downloads": [ { "id": 0, "name": "Woo Single", "file": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg" } ], "download_limit": -1, "download_expiry": -1, "external_url": "", "button_text": "", "tax_status": "taxable", "tax_class": "", "manage_stock": false, "stock_quantity": null, "stock_status": "instock", "backorders": "no", "backorders_allowed": false, "backordered": false, "sold_individually": false, "weight": "", "dimensions": { "length": "", "width": "", "height": "" }, "shipping_required": false, "shipping_taxable": true, "shipping_class": "", "shipping_class_id": 0, "reviews_allowed": true, "average_rating": "0.00", "rating_count": 0, "related_ids": [ 588, 87, 573, 96, 329 ], "upsell_ids": [], "cross_sell_ids": [], "parent_id": 0, "purchase_note": "", "categories": [ { "id": 11, "name": "Music", "slug": "music" }, { "id": 13, "name": "Singles", "slug": "singles" } ], "tags": [], "images": [ { "id": 800, "date_created": "2017-03-23T14:35:43", "date_created_gmt": "2017-03-23T20:35:43", "date_modified": "2017-03-23T14:35:43", "date_modified_gmt": "2017-03-23T20:35:43", "src": "https://example.com/wp-content/uploads/2017/03/cd_4_angle.jpg", "name": "", "alt": "" } ], "attributes": [], "default_attributes": [], "variations": [], "grouped_products": [], "menu_order": 0, "meta_data": [], "_links": { "self": [ { "href": "https://example.com/wp-json/wc/v3/products/801" } ], "collection": [ { "href": "https://example.com/wp-json/wc/v3/products" } ] } }, { "id": 804, "name": "New Premium Quality", "slug": "new-premium-quality", "permalink": "https://example.com/product/new-premium-quality/", "date_created": "2017-03-23T17:35:48", "date_created_gmt": "2017-03-23T20:35:48", "date_modified": "2017-03-23T17:35:48", "date_modified_gmt": "2017-03-23T20:35:48", "type": "simple", "status": "publish", "featured": false, "catalog_visibility": "visible", ``` -------------------------------- ### JSONP Support Example Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/includes/wp-api-v3/_introduction.md This example demonstrates how to use JSONP for GET requests to the WooCommerce REST API, allowing for cross-domain requests by specifying a callback function. ```APIDOC ## GET /wp-json/wc/v3?_jsonp=callback ### Description This endpoint demonstrates how to use JSONP support for GET requests. By appending `?_jsonp=callback` to the endpoint, the response will be wrapped in the specified JavaScript callback function. ### Method GET ### Endpoint `/wp-json/wc/v3?_jsonp=callback` ### Query Parameters - **_jsonp** (string) - Required - The name of the JavaScript callback function to wrap the JSON response. ### Request Example ```shell curl https://example.com/wp-json/wc/v3/products/tags/34?_jsonp=tagDetails \ -u consumer_key:consumer_secret ``` ### Response #### Success Response (200) - **callback** (string) - The JSON response wrapped in the specified JavaScript callback function. #### Response Example ```javascript /**/tagDetails({"id":34,"name":"Leather Shoes","slug":"leather-shoes","description":"","count":0,"_links":{"self":[{"href":"https://example.com/wp-json/wc/v3/products/tags/34"}]},"collection":[{"href":"https://example.com/wp-json/wc/v3/products/tags"}]})% ``` ``` -------------------------------- ### Install WooCommerce Pages Tool Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/includes/wp-api-v3/_system-status-tools.md Installs all the missing WooCommerce pages. Pages already defined and set up will not be replaced. ```APIDOC ## POST /wp-json/wc/v3/system_status/tools/install_pages ### Description This tool will install all the missing WooCommerce pages. Pages already defined and set up will not be replaced. ### Method POST ### Endpoint /wp-json/wc/v3/system_status/tools/install_pages ### Parameters #### Path Parameters - **tool_id** (string) - Required - `install_pages` ### Request Example ```json { "force": true } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the result of the tool execution (e.g., "success"). - **message** (string) - A descriptive message about the outcome of the operation. #### Response Example ```json { "status": "success", "message": "WooCommerce pages installed successfully." } ``` ``` -------------------------------- ### JSON Response Example for Product Update Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/includes/wp-api-v3/_products.md This is an example of the JSON response received after successfully updating a product. ```json { "id": 794, "name": "Premium Quality", "slug": "premium-quality-19", "permalink": "https://example.com/product/premium-quality-19/", "date_created": "2017-03-23T17:01:14", "date_created_gmt": "2017-03-23T20:01:14", "date_modified": "2017-03-23T17:01:14", "date_modified_gmt": "2017-03-23T20:01:14", "type": "simple", "status": "publish", "featured": false, "catalog_visibility": "visible", "description": "
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.
\n", "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
\n", "sku": "", "price": "24.54", "regular_price": "24.54", "sale_price": "", "date_on_sale_from": null, "date_on_sale_from_gmt": null, "date_on_sale_to": null, "date_on_sale_to_gmt": null, "price_html": "24.54", "on_sale": false, "purchasable": true, "total_sales": 0, "virtual": false, "downloadable": false, "downloads": [], "download_limit": -1, "download_expiry": -1, "external_url": "", "button_text": "", "tax_status": "taxable", "tax_class": "", "manage_stock": false, "stock_quantity": null, "stock_status": "instock", "backorders": "no", "backorders_allowed": false, "backordered": false, "sold_individually": false, "weight": "", "dimensions": { "length": "", "width": "", "height": "" }, "shipping_required": true, "shipping_taxable": true, "shipping_class": "", "shipping_class_id": 0, "reviews_allowed": true, "average_rating": "0.00", "rating_count": 0, "related_ids": [ 479, 387, 22, 463, 396 ], "upsell_ids": [], "cross_sell_ids": [], "parent_id": 0, "purchase_note": "", "categories": [ { "id": 9, "name": "Clothing", "slug": "clothing" }, { "id": 14, "name": "T-shirts", "slug": "t-shirts" } ], "tags": [], "images": [ { "id": 792, "date_created": "2017-03-23T14:01:13", "date_created_gmt": "2017-03-23T20:01:13", "date_modified": "2017-03-23T14:01:13", "date_modified_gmt": "2017-03-23T20:01:13", "src": "https://example.com/wp-content/uploads/2017/03/T_2_front-4.jpg", "name": "", "alt": "" }, { "id": 793, "date_created": "2017-03-23T14:01:14", "date_created_gmt": "2017-03-23T20:01:14", "date_modified": "2017-03-23T14:01:14", "date_modified_gmt": "2017-03-23T20:01:14", "src": "https://example.com/wp-content/uploads/2017/03/T_2_back-2.jpg", "name": "", "alt": "" } ], "attributes": [], "default_attributes": [], "variations": [], "grouped_products": [], "menu_order": 0, "meta_data": [], "_links": { "self": [ { "href": "https://example.com/wp-json/wc/v3/products/794" } ], "collection": [ { "href": "https://example.com/wp-json/wc/v3/products" } ] } } ``` -------------------------------- ### Retrieve a System Status Tool (Ruby) Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/includes/wp-api-v3/_system-status-tools.md Ruby example for getting a system status tool via the WooCommerce Ruby SDK. Accesses the parsed response. ```ruby woocommerce.get("system_status/tools/clear_transients").parsed_response ``` -------------------------------- ### JSON Response Example for a Product Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/includes/wp-api-v3/_products.md This is an example of the JSON structure returned when requesting details for a specific product. ```json { "id": 794, "name": "Premium Quality", "slug": "premium-quality-19", "permalink": "https://example.com/product/premium-quality-19/", "date_created": "2017-03-23T17:01:14", "date_created_gmt": "2017-03-23T20:01:14", "date_modified": "2017-03-23T17:01:14", "date_modified_gmt": "2017-03-23T20:01:14", "type": "simple", "status": "publish", "featured": false, "catalog_visibility": "visible", "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.
\n", "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
\n", "sku": "", "price": "21.99", "regular_price": "21.99", "sale_price": "", "date_on_sale_from": null, "date_on_sale_from_gmt": null, "date_on_sale_to": null, "date_on_sale_to_gmt": null, "price_html": "21.99", "on_sale": false, "purchasable": true, "total_sales": 0, "virtual": false, "downloadable": false, "downloads": [], "download_limit": -1, "download_expiry": -1, "external_url": "", "button_text": "", "tax_status": "taxable", "tax_class": "", "manage_stock": false, "stock_quantity": null, "stock_status": "instock", "backorders": "no", "backorders_allowed": false, "backordered": false, "sold_individually": false, "weight": "", "dimensions": { "length": "", "width": "", "height": "" }, "shipping_required": true, "shipping_taxable": true, "shipping_class": "", "shipping_class_id": 0, "reviews_allowed": true, "average_rating": "0.00", "rating_count": 0, "related_ids": [ 53, 40, 56, 479, 99 ], "upsell_ids": [], "cross_sell_ids": [], "parent_id": 0, "purchase_note": "", "categories": [ { "id": 9, "name": "Clothing", "slug": "clothing" }, { "id": 14, "name": "T-shirts", "slug": "t-shirts" } ], "tags": [], "images": [ { "id": 792, "date_created": "2017-03-23T14:01:13", "date_created_gmt": "2017-03-23T20:01:13", "date_modified": "2017-03-23T14:01:13", "date_modified_gmt": "2017-03-23T20:01:13", "src": "https://example.com/wp-content/uploads/2017/03/T_2_front-4.jpg", "name": "", "alt": "" }, { "id": 793, "date_created": "2017-03-23T14:01:14", "date_created_gmt": "2017-03-23T20:01:14", "date_modified": "2017-03-23T14:01:14", "date_modified_gmt": "2017-03-23T20:01:14", "src": "https://example.com/wp-content/uploads/2017/03/T_2_back-2.jpg", "name": "", "alt": "" } ], "attributes": [], "default_attributes": [], "variations": [], "grouped_products": [], "menu_order": 0, "meta_data": [], "_links": { "self": [ { "href": "https://example.com/wp-json/wc/v3/products/794" } ], "collection": [ { "href": "https://example.com/wp-json/wc/v3/products" } ] } } ``` -------------------------------- ### Ruby WooCommerce REST API Installation Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/includes/wp-api-v3/_introduction.md Installation command for the Ruby client library using RubyGems. ```ruby # Install: # gem install woocommerce_api ``` -------------------------------- ### Create a Product Category (Python) Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/includes/wp-api-v3/_product-categories.md Python example demonstrating how to create a product category. The `wcapi` object must be initialized with your API credentials. ```python data = { "name": "Clothing", "image": { "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg" } } print(wcapi.post("products/categories", data).json()) ``` -------------------------------- ### Get System Status Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/includes/wp-api-v3/_system-status.md Retrieves all system status items for the WooCommerce installation. ```APIDOC ## GET /wp-json/wc/v3/system_status ### Description Retrieves all system status items for the WooCommerce installation. This includes details about the environment, database, active plugins, theme, settings, security, and WooCommerce pages. ### Method GET ### Endpoint /wp-json/wc/v3/system_status ### Parameters This endpoint does not accept any parameters. ### Response #### Success Response (200) - **environment** (object) - Environment details. See [System status - Environment properties](#system-status-environment-properties). - **database** (object) - Database details. See [System status - Database properties](#system-status-database-properties). - **active_plugins** (array) - List of active plugins. - **theme** (object) - Theme details. See [System status - Theme properties](#system-status-theme-properties). - **settings** (object) - Settings details. See [System status - Settings properties](#system-status-settings-properties). - **security** (object) - Security details. See [System status - Security properties](#system-status-security-properties). - **pages** (array) - List of WooCommerce pages. #### Response Example ```json { "environment": { "is_ssl_enabled": true, "memory_limit": "256M", "php_version": "8.1.10", "mysql_version": "8.0.30", "web_server_software": "Apache/2.4.54 (Unix)", "php_max_input_vars": 1000, "php_post_max_size": "64M", "php_upload_max_filesize": "64M", "php_max_execution_time": 300, "php_soap_extension_enabled": true, "php_gd_enabled": true, "php_imagick_enabled": true, "php_imagick_version": "6.9.10-47", "php_file_info_enabled": true, "php_json_enabled": true, "php_zip_enabled": true, "php_parse_ini_file_enabled": true, "php_remote_get_contents_enabled": true, "wp_remote_post_supports_ssl": true, "wc_remote_get_contents_timeout": 5, "wc_remote_payment_gateway_timeout": 30, "fs_method": "direct", "is_debug_mode": false }, "database": { "server_version": "8.0.30", "connection_error": false }, "active_plugins": [ { "name": "WooCommerce", "version": "7.0.0", "author": "Automattic", "plugin": "woocommerce/woocommerce.php" } ], "theme": { "name": "Storefront", "version": "16.0.0", "author": "Automattic", "is_child_theme": false, "parent_theme": null }, "settings": { "currency": "USD", "locale": "en_US", "tax_enabled": true, "shipping_enabled": true, "coupon_enabled": true, "reviews_enabled": true }, "security": { "status": "good", "messages": [] }, "pages": [ { "id": 2, "title": "Shop", "url": "http://example.com/shop/" } ] } ``` ``` -------------------------------- ### Get System Status Tools via cURL Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/includes/wp-api-v3/_system-status-tools.md Use this command-line tool to fetch system status tools from the WooCommerce API. Ensure you replace 'example.com' with your store's URL and provide your consumer key and secret. ```shell curl https://example.com/wp-json/wc/v3/system_status/tools \ -u consumer_key:consumer_secret ``` -------------------------------- ### List All Product Categories (Python) Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/includes/wp-api-v3/_product-categories.md Get all product categories using the WooCommerce Python SDK. This example demonstrates making the GET request and printing the JSON response. ```python print(wcapi.get("products/categories").json()) ``` -------------------------------- ### Retrieve General Settings via PHP Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/includes/wp-api-v3/_setting-options.md A PHP example showing how to retrieve general settings using the WooCommerce API client. The output is printed directly. ```php get('settings/general')); ?> ``` -------------------------------- ### Get Specific Product Variation (Python) Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/includes/wp-api-v3/_product-variations.md This Python example uses the WooCommerce API client to get a specific product variation. The `.json()` method is called to parse the response. ```python print(wcapi.get("products/22/variations/732").json()) ``` -------------------------------- ### Get Product Variations using WooCommerce Python Library Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/includes/wp-api-v3/_product-variations.md This Python example shows how to get product variations using the WooCommerce Python API client. The response is returned as JSON. ```python print(wcapi.get("products/22/variations").json()) ``` -------------------------------- ### Create Customer with Python SDK Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/includes/wp-api-v3/_customers.md This Python example demonstrates creating a customer using the WooCommerce API client. It defines the customer data and then makes a POST request. ```python data = { "email": "john.doe@example.com", "first_name": "John", "last_name": "Doe", "username": "john.doe", "billing": { "first_name": "John", "last_name": "Doe", "company": "", "address_1": "969 Market", "address_2": "", "city": "San Francisco", "state": "CA", "postcode": "94103", "country": "US", "email": "john.doe@example.com", "phone": "(555) 555-5555" }, "shipping": { "first_name": "John", "last_name": "Doe", "company": "", "address_1": "969 Market", "address_2": "", "city": "San Francisco", "state": "CA", "postcode": "94103", "country": "US" } } print(wcapi.post("customers", data).json()) ``` -------------------------------- ### Build WooCommerce Docs Locally Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/README.md Run this script to generate the documentation locally after making changes. The output will be in the 'build' directory. ```bash ./build.sh ``` -------------------------------- ### Get Order Email Templates with Python Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/includes/wp-api-v3/_order-actions.md This Python example uses the WooCommerce API client to get the email templates for a specific order. The `.json()` method is called to parse the response. ```python print(wcapi.get("orders/723/actions/email_templates").json()) ``` -------------------------------- ### Create a Product Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/includes/wp-api-v3/_index.md Creates a new product. ```APIDOC ## POST /products ### Description Creates a new product. ### Method POST ### Endpoint /wp-json/wc/v3/products ### Request Body - **name** (string) - Required - Product name. - **slug** (string) - Optional - Product slug. - **type** (string) - Optional - Product type. Default: "simple" - **status** (string) - Optional - Product status. Default: "publish" - **description** (string) - Optional - Product description. - **short_description** (string) - Optional - Product short description. - **sku** (string) - Optional - Unique identifier for the product. - **price** (string) - Optional - Product price. - **regular_price** (string) - Optional - Product regular price. - **sale_price** (string) - Optional - Product sale price. - **date_on_sale_from** (string) - Optional - Start date of sale price, in the site's timezone. - **date_on_sale_to** (string) - Optional - End date of sale price, in the site's timezone. - **purchasable** (boolean) - Optional - Whether or not the product can be purchased. Default: true - **virtual** (boolean) - Optional - Whether or not the product is virtual. Default: false - **downloadable** (boolean) - Optional - Whether or not the product is downloadable. Default: false - **download_limit** (integer) - Optional - Download limit. Default: -1 - **download_expiry_days** (integer) - Optional - Download expiry days. Default: -1 - **download_type** (string) - Optional - Download type. Default: "standard" - **external_url** (string) - Optional - External URL for the product. - **button_text** (string) - Optional - External URL button text. - **tax_status** (string) - Optional - Tax status. Default: "taxable" - **tax_class** (string) - Optional - Tax class. Default: "" - **manage_stock** (boolean) - Optional - Whether or not to manage stock. Default: false - **stock_quantity** (integer) - Optional - Stock quantity. - **backorders** (string) - Optional - How to handle backorders. Default: "no" - **low_stock_amount** (integer) - Optional - The low stock amount. - **sold_individually** (boolean) - Optional - Whether or not to sell individually. Default: false - **weight** (string) - Optional - Product weight. - **dimensions** (object) - Optional - Product dimensions. - **shipping_required** (boolean) - Optional - Whether or not shipping is required. - **shipping_taxable** (boolean) - Optional - Whether or not shipping is taxable. - **shipping_class** (string) - Optional - Shipping class. - **shipping_class_id** (integer) - Optional - Shipping class ID. - **reviews_allowed** (boolean) - Optional - Whether or not reviews are allowed. Default: true - **purchase_note** (string) - Optional - Note to include with purchase. - **categories** (array) - Optional - List of category IDs. - **tags** (array) - Optional - List of tag IDs. - **images** (array) - Optional - List of images. - **attributes** (array) - Optional - List of attributes. - **default_attributes** (array) - Optional - List of default attributes. - **variations** (array) - Optional - List of variations. - **grouped_products** (array) - Optional - List of grouped products. - **menu_order** (integer) - Optional - Menu order. ### Request Example ```json { "name": "Awesome T-Shirt", "type": "variable", "regular_price": "25.00", "description": "A comfortable and stylish T-shirt.", "sku": "TSHIRT-AWESOME", "images": [ { "src": "http://example.com/wp-content/uploads/2023/01/tshirt.jpg" } ], "attributes": [ { "id": 1, "position": 0, "visible": true, "variation": true }, { "id": 2, "position": 1, "visible": true, "variation": true } ], "default_attributes": [ { "id": 1, "option": "Red" }, { "id": 2, "option": "M" } ] } ``` ### Response #### Success Response (201) - **id** (integer) - Unique identifier for the resource. - **name** (string) - Product name. - **slug** (string) - Product slug. - **permalink** (string) - URL of the product. - **date_created** (string) - The date the product was created, in the site's timezone. - **date_modified** (string) - The date the product was last modified, in the site's timezone. - **type** (string) - Product type. - **status** (string) - Product status. - **featured** (boolean) - Whether or not the product is featured. - **catalog_visibility** (string) - Visibility in catalog pages and search results. - **description** (string) - Product description. - **short_description** (string) - Product short description. - **sku** (string) - Unique identifier for the product. - **price** (string) - Product price. - **regular_price** (string) - Product regular price. - **sale_price** (string) - Product sale price. - **date_on_sale_from** (string) - Start date of sale price, in the site's timezone. - **date_on_sale_to** (string) - End date of sale price, in the site's timezone. - **on_sale** (boolean) - Whether or not the product is on sale. - **purchasable** (boolean) - Whether or not the product can be purchased. - **total_sales** (integer) - Product total sales. - **virtual** (boolean) - Whether or not the product is virtual. - **downloadable** (boolean) - Whether or not the product is downloadable. - **download_limit** (integer) - Download limit. - **download_expiry_days** (integer) - Download expiry days. - **download_type** (string) - Download type. - **external_url** (string) - External URL for the product. - **button_text** (string) - External URL button text. - **tax_status** (string) - Tax status. - **tax_class** (string) - Tax class. - **manage_stock** (boolean) - Whether or not to manage stock. - **stock_quantity** (integer) - Stock quantity. - **backorders** (string) - How to handle backorders. - **low_stock_amount** (integer) - The low stock amount. - **sold_individually** (boolean) - Whether or not to sell individually. - **weight** (string) - Product weight. - **dimensions** (object) - Product dimensions. - **shipping_required** (boolean) - Whether or not shipping is required. - **shipping_taxable** (boolean) - Whether or not shipping is taxable. - **shipping_class** (string) - Shipping class. - **shipping_class_id** (integer) - Shipping class ID. - **reviews_allowed** (boolean) - Whether or not reviews are allowed. - **average_rating** (string) - Average rating. - **rating_count** (integer) - Number of reviews. - **related_ids** (array) - List of related products. - **upsell_ids** (array) - List of upsell products. - **cross_sell_ids** (array) - List of cross-sell products. - **parent_id** (integer) - Parent product ID. - **purchase_note** (string) - Note to include with purchase. - **categories** (array) - List of categories. - **tags** (array) - List of tags. - **images** (array) - List of images. - **attributes** (array) - List of attributes. - **default_attributes** (array) - List of default attributes. - **variations** (array) - List of variations. - **grouped_products** (array) - List of grouped products. - **menu_order** (integer) - Menu order. - **price_html** (string) - Price HTML. #### Response Example ```json { "id": 10, "name": "Awesome T-Shirt", "slug": "awesome-t-shirt", "permalink": "https://example.com/product/awesome-t-shirt/", "date_created": "2023-01-02T10:00:00", "date_modified": "2023-01-02T10:00:00", "type": "variable", "status": "publish", "featured": false, "catalog_visibility": "visible", "description": "A comfortable and stylish T-shirt.", "short_description": "", "sku": "TSHIRT-AWESOME", "price": "", "regular_price": "25.00", "sale_price": "", "date_on_sale_from": null, "date_on_sale_to": null, "on_sale": false, "purchasable": true, "total_sales": 0, "virtual": false, "downloadable": false, "download_limit": -1, "download_expiry_days": -1, "download_type": "standard", "external_url": "", "button_text": "", "tax_status": "taxable", "tax_class": "", "manage_stock": false, "stock_quantity": null, "backorders": "no", "low_stock_amount": null, "sold_individually": false, "weight": "", "dimensions": { "length": "", "width": "", "height": "" }, "shipping_required": true, "shipping_taxable": true, "shipping_class": "", "shipping_class_id": 0, "reviews_allowed": true, "average_rating": "0.00", "rating_count": 0, "related_ids": [], "upsell_ids": [], "cross_sell_ids": [], "parent_id": 0, "purchase_note": "", "categories": [], "tags": [], "images": [ { "id": 11, "date_created": "2023-01-02T10:00:00", "date_modified": "2023-01-02T10:00:00", "src": "http://example.com/wp-content/uploads/2023/01/tshirt.jpg", "name": "tshirt", "alt": "" } ], "attributes": [ { "id": 1, "name": "Color", "option": "Red", "position": 0, "visible": true, "variation": true }, { "id": 2, "name": "Size", "option": "M", "position": 1, "visible": true, "variation": true } ], "default_attributes": [ { "id": 1, "name": "Color", "option": "Red" }, { "id": 2, "name": "Size", "option": "M" } ], "variations": [], "grouped_products": [], "menu_order": 0, "price_html": "$25.00" } ``` ``` -------------------------------- ### Introduction to WooCommerce REST API v3 Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/v3.html.md This section provides an overview of the WooCommerce REST API v3, its capabilities, and how to get started. ```APIDOC ## Introduction to WooCommerce REST API v3 ### Description This API allows you to interact with your WooCommerce store programmatically. You can manage products, orders, customers, and more. ### Warning This documentation is for the WooCommerce API v3 API which is now deprecated. Please use the latest REST API version. ``` -------------------------------- ### Retrieve a specific tax rate using Python Source: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/trunk/source/includes/wp-api-v3/_taxes.md This Python example shows how to get a specific tax rate using its ID via the WooCommerce REST API. It uses the wcapi library to perform the GET request and print the JSON response. ```python print(wcapi.get("taxes/72").json()) ```