DescriptionThis API lets you retrieve and view all products or a specific product by ID.
WooCommerce B2B available meta fields:
- wcb2b_product_group_prices: contains dedicated prices by group.
Value is a multidimensional array with GROUP ID as key and associative subarray:- regular_price: dedicated group regular price. It's a floating number
- sale_price: dedicated group sale price. It's a floating number
In API GET response, has also a dedicated field alias named "wcb2b_group_prices" - wcb2b_product_group_tier_prices: contains tiered prices by group.
Value is a multidimensional array with GROUP ID as key and associative subarray:- {QUANTITY}: minimum quantity to apply tier price. It's an integer number
- {PRICE}: tier price. It's a floating number
In API GET response, has also a dedicated field alias named "wcb2b_group_tier_prices" - wcb2b_product_group_packages: contains package increment quantity.
Value is an array with GROUP ID as key and integer package as value.
In API GET response, has also a dedicated field alias named "wcb2b_packages_quantity" - wcb2b_product_group_min: contains minimum quantity allowed.
Value is an array with GROUP ID as key and integer quantity value.
In API GET response, has also a dedicated field alias named "wcb2b_min_quantity" - wcb2b_product_group_max: contains maximum quantity allowed.
Value is an array with GROUP ID as key and integer quantity value.
In API GET response, has also a dedicated field alias named "wcb2b_max_quantity" - wcb2b_barcode: contains product barcode.
Value is a string
In API GET response, has also a dedicated field alias named "wcb2b_barcode" - wcb2b_product_group_hide_prices: contains groups with hidden prices.
Value is an array with GROUP IDs
In API GET response, has also a dedicated field alias named "wcb2b_group_hide_prices" - wcb2b_product_group_hide_stocks: contains groups with hidden stocks.
Value is an array with GROUP IDs
In API GET response, has also a dedicated field alias named "wcb2b_group_hide_stocks"
Note: WooCommerce B2B extends default WooCommerce products REST API with own custom meta fields. For more informations, please visit: WooCommerce Official documentation
HTTP request (all products) get
/wp-json/wc/v3/products
HTTP request (single product) get
/wp-json/wc/v3/products/{ID}
Example response
{
"id": 60,
"name": "T-Shirt with Logo",
"slug": "t-shirt-with-logo",
"permalink": "https://demo.woocommerce-b2b.com/product/t-shirt-with-logo/",
"date_created": "2020-06-13 00:00:00",
"date_created_gmt": "2020-06-13 00:00:00",
"date_modified": "2020-06-13 00:00:00",
"date_modified_gmt": "2020-06-13 00:00:00",
"type": "simple",
"status": "publish",
"featured": false,
"catalog_visibility": "visible",
"description": "<p>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.</p>\n",
"short_description": "<p>This is a simple product.</p>\n",
"sku": "Woo-tshirt-logo",
"price": "98",
"regular_price": "100",
"sale_price": "98",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"price_html": "<del><span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">$</span>100.00</span></del> <ins><span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">$</span>98.00</span></ins>",
"on_sale": true,
"purchasable": true,
"total_sales": 0,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": 0,
"download_expiry": 0,
"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": "10",
"width": "12",
"height": "0.5"
},
"shipping_required": true,
"shipping_taxable": true,
"shipping_class": "",
"shipping_class_id": 0,
"reviews_allowed": true,
"average_rating": "0.00",
"rating_count": 0,
"related_ids": [
50,
40,
43,
51
],
"upsell_ids": [],
"cross_sell_ids": [],
"parent_id": 0,
"purchase_note": "",
"categories": [
{
"id": 20,
"name": "Tshirts",
"slug": "tshirts-clothing"
}
],
"tags": [],
"images": [
{
"id": 83,
"date_created": "2020-06-13 00:00:00",
"date_created_gmt": "2020-06-13 00:00:00",
"date_modified": "2020-06-13 00:00:00",
"date_modified_gmt": "2020-06-13 00:00:00",
"src": "https://demo.woocommerce-b2b.com/wp-content/uploads/2020/06/t-shirt-with-logo-1.jpg",
"name": "t-shirt-with-logo-1.jpg",
"alt": ""
}
],
"attributes": [
{
"id": 1,
"name": "Color",
"position": 0,
"visible": true,
"variation": false,
"options": [
"Gray"
]
}
],
"default_attributes": [],
"variations": [],
"grouped_products": [],
"menu_order": 0,
"meta_data": [
{
"id": 967,
"key": "_wpcom_is_markdown",
"value": "1"
},
{
"id": 3150,
"key": "wcb2b_barcode",
"value": "0123456789"
},
{
"id": 3151,
"key": "wcb2b_product_group_packages",
"value": {
"274" : "10",
"275" : "10",
"276" : "10",
"277" : "10",
"278" : "10"
}
},
{
"id": 3152,
"key": "wcb2b_product_group_min",
"value": {
"274" : "20",
"275" : "20",
"276" : "20",
"277" : "20",
"278" : "20"
}
},
{
"id": 3153,
"key": "wcb2b_product_group_max",
"value": {
"274" : "200",
"275" : "200",
"276" : "200",
"277" : "200",
"278" : "200"
}
},
{
"id": 245144,
"key": "wcb2b_product_group_hide_prices",
"value": [
275
]
},
{
"id": 245145,
"key": "wcb2b_product_group_hide_stocks",
"value": [
275
]
},
{
"id": 3154,
"key": "wcb2b_product_group_prices",
"value": {
"274": {
"regular_price": "",
"sale_price": ""
},
"275": {
"regular_price": "",
"sale_price": ""
},
"276": {
"regular_price": "95.00",
"sale_price": ""
},
"277": {
"regular_price": "98.00",
"sale_price": ""
},
"278": {
"regular_price": "80.00",
"sale_price": "78.00"
}
}
},
{
"id": 3155,
"key": "wcb2b_product_group_tier_prices",
"value": {
"275": {
"100": "50.00"
},
"278": {
"5": "75.00",
"10": "74.00",
"20": "70.00"
}
}
}
],
"wcb2b_group_hide_prices": [
[
275
]
],
"wcb2b_group_tier_prices": [
{
"275": {
"100": "50.00"
},
"278": {
"5": "75.00",
"10": "74.00",
"20": "70.00"
}
}
],
"wcb2b_group_prices": [
{
"274": {
"regular_price": "",
"sale_price": ""
},
"275": {
"regular_price": "",
"sale_price": ""
},
"276": {
"regular_price": "95.00",
"sale_price": ""
},
"277": {
"regular_price": "98.00",
"sale_price": ""
},
"278": {
"regular_price": "80.00",
"sale_price": "78.00"
}
}
],
"wcb2b_barcode": [
"0123456789"
],
"wcb2b_package_quantity": {
"274" : "10",
"275" : "10",
"276" : "10",
"277" : "10",
"278" : "10"
},
"wcb2b_max_quantity": {
"274" : "200",
"275" : "200",
"276" : "200",
"277" : "200",
"278" : "200"
},
"wcb2b_min_quantity": {
"274" : "20",
"275" : "20",
"276" : "20",
"277" : "20",
"278" : "20"
},
"_links": {
"self": [
{
"href": "https://demo.woocommerce-b2b.com/wp-json/wc/v3/products/60"
}
],
"collection": [
{
"href": "https://demo.woocommerce-b2b.com/wp-json/wc/v3/products"
}
]
}
}