Products
This endpoint is an extension of the official WC's products endpoint with extra info added by ATUM and/or its add-ons. You can identify the ATUM data with the corresponding labels.
The products API allows you to create, view, update, and delete individual, or a batch, of products.
The ATUM fields are only exposed through the WooCommerce REST API (/wp-json/wc/v3). Some of them also depend on the enabled ATUM modules and on the capabilities of the user that owns the API keys:
purchase_priceneeds the Purchase Orders module and theatum_view_purchase_pricecapability (andatum_edit_purchase_priceto change it).supplier_idandsupplier_skuneed the Purchase Orders module and theatum_read_private_supplierscapability.inbound_stockneeds the Purchase Orders module and theatum_read_inbound_stockcapability.has_locationandatum_locationsneed the Purchase Orders module and theatum_manage_location_termscapability.reserved_stock,customer_returns,warehouse_damage,lost_in_postandother_logsneed the Inventory Logs module.barcodeneeds the Barcodes module.- Changing
out_stock_thresholdneeds theatum_edit_out_stock_thresholdcapability.
Product properties
| Attribute | Type | Description |
|---|---|---|
id | integer | Unique identifier for the resource. read-only |
name | string | Product name. |
slug | string | Product slug. |
permalink | string | Product URL. read-only |
date_created | date-time | The date the product was created, in the site's timezone. read-only |
date_created_gmt | date-time | The date the product was created, as GMT. read-only |
date_modified | date-time | The date the product was last modified, in the site's timezone. read-only |
date_modified_gmt | date-time | The date the product was last modified, as GMT. read-only |
type | string | Product type. Options: simple, grouped, external, variable, product-part, raw-material, variable-product-part and variable-raw-material. Default is simple. |
status | string | Product status (post status). Options: draft, pending, private and publish. Default is publish. |
featured | boolean | Featured product. Default is false. |
catalog_visibility | string | Catalog visibility. Options: visible, catalog, search and hidden. Default is visible. |
description | string | Product description. |
short_description | string | Product short description. |
sku | string | Unique identifier. |
price | string | Current product price. read-only |
regular_price | string | Product regular price. |
sale_price | string | Product sale price. |
date_on_sale_from | date-time | Start date of sale price, in the site's timezone. |
date_on_sale_from_gmt | date-time | Start date of sale price, as GMT. |
date_on_sale_to | date-time | End date of sale price, in the site's timezone. |
date_on_sale_to_gmt | date-time | End date of sale price, as GMT. |
price_html | string | Price formatted in HTML. read-only |
on_sale | boolean | Shows if the product is on sale. read-only |
purchasable | boolean | Shows if the product can be bought. read-only |
total_sales | integer | Amount of sales. read-only |
virtual | boolean | If the product is virtual. Default is false. |
downloadable | boolean | If the product is downloadable. Default is false. |
downloads | array | List of downloadable files. See Product - Downloads properties |
download_limit | integer | Number of times downloadable files can be downloaded after purchase. Default is -1. |
download_expiry | integer | Number of days until access to downloadable files expires. Default is -1. |
external_url | string | Product external URL. Only for external products. |
button_text | string | Product external button text. Only for external products. |
tax_status | string | Tax status. Options: taxable, shipping and none. Default is taxable. |
tax_class | string | Tax class. |
manage_stock | boolean | Stock management at product level. Default is false. |
stock_quantity | integer | Stock quantity. If the ATUM's "Decimals in stock quantity" setting is greater than 0, decimal numbers are also accepted. ATUM |
stock_status | string | Controls the stock status of the product. Options: instock, outofstock, onbackorder. Default is instock. |
backorders | string | If managing stock, this controls if backorders are allowed. Options: no, notify and yes. Default is no. |
backorders_allowed | boolean | Shows if backorders are allowed. read-only |
backordered | boolean | Shows if the product is on backordered. read-only |
sold_individually | boolean | Allow one item to be bought in a single order. Default is false. |
weight | string | Product weight. |
dimensions | object | Product dimensions. See Product - Dimensions properties |
shipping_required | boolean | Shows if the product need to be shipped. read-only |
shipping_taxable | boolean | Shows whether or not the product shipping is taxable. read-only |
shipping_class | string | Shipping class slug. |
shipping_class_id | integer | Shipping class ID. read-only |
reviews_allowed | boolean | Allow reviews. Default is true. |
average_rating | string | Reviews average rating. read-only |
rating_count | integer | Amount of reviews that the product have. read-only |
related_ids | array | List of related products IDs. read-only |
upsell_ids | array | List of up-sell products IDs. |
cross_sell_ids | array | List of cross-sell products IDs. |
parent_id | integer | Product parent ID. |
purchase_note | string | Optional note to send the customer after purchase. |
categories | array | List of categories. See Product - Categories properties |
tags | array | List of tags. See Product - Tags properties |
images | array | List of images. See Product - Images properties |
attributes | array | List of attributes. See Product - Attributes properties |
default_attributes | array | Defaults variation attributes. See Product - Default attributes properties |
variations | array | List of variations IDs. read-only |
grouped_products | array | List of grouped products ID. |
menu_order | integer | Menu order, used to custom sort products. |
meta_data | array | Meta data. See Product - Meta data properties |
purchase_price | number | Product's purchase price. ATUM |
supplier_id | integer | The ID of the ATUM Supplier that is linked to this product. ATUM |
supplier_sku | string | The Supplier's SKU for this product. ATUM |
barcode | string | The barcode for this product. ATUM |
atum_controlled | boolean | Whether this product is being controlled by ATUM. Default is false. ATUM |
out_stock_date | date-time | The date when this product run out of stock. ATUM |
out_stock_threshold | number | Out of stock threshold at product level. ATUM |
inheritable | boolean | Whether this product may have children. Default is false. ATUM |
inbound_stock | number | Product's inbound stock. ATUM |
stock_on_hold | number | Product's stock on hold. ATUM |
sold_today | number | Units sold today. ATUM |
sales_last_days | number | Sales the last 14 days. ATUM |
reserved_stock | number | Stock set as 'reserved_stock' within Inventory Logs. ATUM |
customer_returns | number | Stock set as 'customer returns' within Inventory Logs. ATUM |
warehouse_damage | number | Stock set as 'warehouse damage' within Inventory Logs. ATUM |
lost_in_post | number | Stock set as 'lost in post' within Inventory Logs. ATUM |
other_logs | number | Stock set as 'other' within Inventory Logs. ATUM |
out_stock_days | integer | The number of days that the product is Out of stock. ATUM |
lost_sales | number | Product lost sales. ATUM |
has_location | boolean | Whether this product has any ATUM location set. ATUM |
update_date | date-time | Last date when the ATUM product data was calculated and saved for this product. ATUM |
atum_locations | array | List of ATUM locations linked to the product. See Product - ATUM locations properties ATUM |
atum_stock_status | string | The stock status saved by ATUM. It uses the same values as stock_status, but both may differ for products with Multi-Inventory enabled. ATUM |
restock_status | boolean | Indicates whether the stock will run out soon and the product should be reordered. ATUM |
sales_update_date | date-time | Last date when the sales fields of the ATUM product data were calculated and saved for this product. ATUM |
calc_backorders | number | Backordered items (if backorders are allowed and the product has a negative stock quantity). ATUM |
mi_inventories | array | An array of inventory IDs linked to the product. It is only filled when the product has Multi-Inventory enabled and a compatible product type. Multi-Inventory ATUM read-only |
multi_inventory | string | The Multi Inventory status for this product. Options: yes, no, global. Multi-Inventory ATUM |
inventory_sorting_mode | string | The sorting mode specified for inventory selling priority. Options: fifo, lifo, bbe, manual, global. Multi-Inventory ATUM |
inventory_iteration | string | What to do when the first selling inventory runs out of stock. Options: use_next, out_of_stock, global. Multi-Inventory ATUM |
expirable_inventories | string | Set the inventories as 'Out of Stock' when reaching their BBE dates. Options: yes, no, global. Multi-Inventory ATUM |
price_per_inventory | string | Allow distinct inventories to have distinct prices. Options: yes, no, global. Multi-Inventory ATUM |
show_write_off_inventories | string | Whether to show the written off inventories. Options: yes, no, global. Multi-Inventory ATUM |
selectable_inventories | string | Whether the selectable inventories is enabled. Options: yes, no, global. Multi-Inventory ATUM |
selectable_inventories_mode | string | The inventory selection mode for the frontend display. Options: dropdown, list, global. Multi-Inventory ATUM |
linked_bom | array | The BOM linked to the product with their quantities. See Product - Linked BOM properties Product Levels ATUM |
bom_sellable | boolean | If the product is a BOM, indicates whether the product is sellable. It returns null for the products using the global setting value. Product Levels ATUM |
minimum_threshold | number | If the product is a BOM, indicates the product's minimum threshold. Product Levels ATUM |
available_to_purchase | number | If the product is a BOM, indicates the product's available to purchase amount. Product Levels ATUM |
selling_priority | integer | If the product is a BOM, indicates the product's selling priority. Product Levels ATUM |
calculated_stock | number | If the BOM stock control is enabled and the product has linked BOM, it indicates the calculated stock quantity. Product Levels ATUM |
sync_purchase_price | boolean | Whether to sync the product's purchase price with the BOM's purchase price. Default is false. Product Levels ATUM |
is_bom | boolean | Whether the product is a BOM (product part or raw material). Default is false. Product Levels ATUM |
The Multi-Inventory fields (except mi_inventories) are not returned for product types that aren't compatible with Multi-Inventory, and only mi_inventories and multi_inventory are returned when the product doesn't have Multi-Inventory enabled.
When a product has Multi-Inventory enabled, or it has linked BOM and the BOM stock control is enabled, the manage_stock, stock_quantity and stock_status values sent in the request are ignored, as the stock is handled by the add-ons.
Product - Downloads properties
| Attribute | Type | Description |
|---|---|---|
id | string | File ID. |
name | string | File name. |
file | string | File URL. |
Product - Dimensions properties
| Attribute | Type | Description |
|---|---|---|
length | string | Product length. |
width | string | Product width. |
height | string | Product height. |
Product - Categories properties
| Attribute | Type | Description |
|---|---|---|
id | integer | Category ID. |
name | string | Category name. read-only |
slug | string | Category slug. read-only |
Product - Tags properties
| Attribute | Type | Description |
|---|---|---|
id | integer | Tag ID. |
name | string | Tag name. read-only |
slug | string | Tag slug. read-only |
Product - Images properties
| Attribute | Type | Description |
|---|---|---|
id | integer | Image ID. |
date_created | date-time | The date the image was created, in the site's timezone. read-only |
date_created_gmt | date-time | The date the image was created, as GMT. read-only |
date_modified | date-time | The date the image was last modified, in the site's timezone. read-only |
date_modified_gmt | date-time | The date the image was last modified, as GMT. read-only |
src | string | Image URL. |
name | string | Image name. |
alt | string | Image alternative text. |
Product - Attributes properties
| Attribute | Type | Description |
|---|---|---|
id | integer | Attribute ID. |
name | string | Attribute name. |
position | integer | Attribute position. |
visible | boolean | Define if the attribute is visible on the "Additional information" tab in the product's page. Default is false. |
variation | boolean | Define if the attribute can be used as variation. Default is false. |
options | array | List of available term names of the attribute. |
option_ids | array | IDs of the attribute terms assigned to the product. For custom (non-global) attributes, it contains the option names. ATUM read-only |
Product - Default attributes properties
| Attribute | Type | Description |
|---|---|---|
id | integer | Attribute ID. |
name | string | Attribute name. |
option | string | Selected attribute term name. |
Product - Meta data properties
| Attribute | Type | Description |
|---|---|---|
id | integer | Meta ID. read-only |
key | string | Meta key. |
value | string | Meta value. |
Product - ATUM locations properties
ATUM| Attribute | Type | Description |
|---|---|---|
id | integer | Location ID. |
name | string | Location name. read-only |
slug | string | Location slug. read-only |
Product - Linked BOM properties
ATUM Product Levels| Attribute | Type | Description |
|---|---|---|
bom_id | integer | The linked BOM product ID. mandatory |
bom_type | string | The linked BOM product type. Options: raw_material, product_part. Required unless delete is true. |
qty | number | The linked BOM quantity. It cannot be negative. Required unless delete is true. |
measure_unit | string | The linked BOM measure unit. |
delete | boolean | Whether to delete the linked BOM from the product. write-only |
Create a product
This API helps you to create a new product.
HTTP request
/wp-json/wc/v3/productsExample of how to create a simple product with ATUM data
curl -X POST https://example.com/wp-json/wc/v3/products \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"name": "ATUM Test Product",
"type": "simple",
"regular_price": "21.99",
"purchase_price": 15.2,
"supplier_id": 399,
"supplier_sku": "TEST1",
"barcode": "AAAAAABBBBBB",
"atum_controlled": true,
"linked_bom": [
{
"bom_id": 175,
"bom_type": "product_part",
"qty": 3
}
],
"atum_locations": [
{
"id": 39
},
{
"id": 37
}
],
"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.",
"short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
"categories": [
{
"id": 9
},
{
"id": 14
}
],
"images": [
{
"src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
},
{
"src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg"
}
]
}'{
"id": 1998,
"name": "ATUM Test Product",
"slug": "atum-test-product",
"permalink": "https://example.com/product/atum-test-product/",
"date_created": "2019-11-06T08:54:04",
"date_created_gmt": "2019-11-06T07:54:04",
"date_modified": "2019-11-06T08:54:04",
"date_modified_gmt": "2019-11-06T07:54:04",
"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.",
"short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
"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": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">€</span>21,99</span>",
"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",
"rating_count": 0,
"related_ids": [
37,
103,
60,
19,
15
],
"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": 1996,
"date_created": "2019-11-06T09:54:03",
"date_created_gmt": "2019-11-06T07:54:03",
"date_modified": "2019-11-06T09:54:03",
"date_modified_gmt": "2019-11-06T07:54:03",
"src": "https://example.com/wp-content/uploads/2019/11/T_2_front-8.jpg",
"name": "T_2_front-8.jpg",
"alt": ""
},
{
"id": 1997,
"date_created": "2019-11-06T09:54:04",
"date_created_gmt": "2019-11-06T07:54:04",
"date_modified": "2019-11-06T09:54:04",
"date_modified_gmt": "2019-11-06T07:54:04",
"src": "https://example.com/wp-content/uploads/2019/11/T_2_back-8.jpg",
"name": "T_2_back-8.jpg",
"alt": ""
}
],
"attributes": [],
"default_attributes": [],
"variations": [],
"grouped_products": [],
"menu_order": 0,
"meta_data": [],
"purchase_price": 15.2,
"supplier_id": 399,
"supplier_sku": "TEST1",
"barcode": "AAAAAABBBBBB",
"atum_controlled": true,
"out_stock_date": null,
"out_stock_threshold": 0,
"inheritable": false,
"inbound_stock": null,
"stock_on_hold": null,
"sold_today": null,
"sales_last_days": null,
"reserved_stock": null,
"customer_returns": null,
"warehouse_damage": null,
"lost_in_post": null,
"other_logs": null,
"out_stock_days": null,
"lost_sales": null,
"has_location": null,
"update_date": "2019-11-06T06:54:12",
"atum_locations": [
{
"id": 39,
"name": "Italy",
"slug": "italy"
},
{
"id": 37,
"name": "Spain",
"slug": "spain"
}
],
"atum_stock_status": "instock",
"restock_status": false,
"sales_update_date": "2019-11-06T06:54:12",
"calc_backorders": null,
"linked_bom": [
{
"bom_id": 175,
"bom_type": "product_part",
"qty": 3,
"measure_unit": null
}
],
"sync_purchase_price": false,
"is_bom": false,
"mi_inventories": [],
"multi_inventory": "global",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/products/1998"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products"
}
]
}
}Example of how to create a variable product part product with global and non-global attributes
curl -X POST https://example.com/wp-json/wc/v3/products \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"name": "ATUM BOM Test",
"type": "variable-product-part",
"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.",
"short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
"categories": [
{
"id": 9
},
{
"id": 14
}
],
"images": [
{
"src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg"
},
{
"src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_back.jpg"
},
{
"src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg"
},
{
"src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_back.jpg"
}
],
"attributes": [
{
"id": 6,
"position": 0,
"visible": false,
"variation": true,
"options": [
"Black",
"Green"
]
},
{
"name": "Size",
"position": 0,
"visible": true,
"variation": true,
"options": [
"S",
"M"
]
}
],
"default_attributes": [
{
"id": 6,
"option": "Black"
},
{
"name": "Size",
"option": "S"
}
]
}'{
"id": 2101,
"name": "ATUM BOM Test",
"slug": "atum-bom-test-2",
"permalink": "https://example.com/product/atum-bom-test/",
"date_created": "2019-11-06T12:44:23",
"date_created_gmt": "2019-11-06T11:44:23",
"date_modified": "2019-11-06T12:44:23",
"date_modified_gmt": "2019-11-06T11:44:23",
"type": "variable-product-part",
"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.",
"short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
"sku": "",
"price": "",
"regular_price": "",
"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": "",
"on_sale": false,
"purchasable": false,
"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": "outofstock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"sold_individually": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_required": false,
"shipping_taxable": false,
"shipping_class": "",
"shipping_class_id": 0,
"reviews_allowed": true,
"average_rating": "0",
"rating_count": 0,
"related_ids": [
31,
103,
19,
47,
2096
],
"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": 2097,
"date_created": "2019-11-06T13:44:21",
"date_created_gmt": "2019-11-06T11:44:21",
"date_modified": "2019-11-06T13:44:21",
"date_modified_gmt": "2019-11-06T11:44:21",
"src": "https://example.com/wp-content/uploads/2019/11/T_4_front-20.jpg",
"name": "T_4_front-20.jpg",
"alt": ""
},
{
"id": 2098,
"date_created": "2019-11-06T13:44:21",
"date_created_gmt": "2019-11-06T11:44:21",
"date_modified": "2019-11-06T13:44:21",
"date_modified_gmt": "2019-11-06T11:44:21",
"src": "https://example.com/wp-content/uploads/2019/11/T_4_back-20.jpg",
"name": "T_4_back-20.jpg",
"alt": ""
},
{
"id": 2099,
"date_created": "2019-11-06T13:44:22",
"date_created_gmt": "2019-11-06T11:44:22",
"date_modified": "2019-11-06T13:44:22",
"date_modified_gmt": "2019-11-06T11:44:22",
"src": "https://example.com/wp-content/uploads/2019/11/T_3_front-20.jpg",
"name": "T_3_front-20.jpg",
"alt": ""
},
{
"id": 2100,
"date_created": "2019-11-06T13:44:22",
"date_created_gmt": "2019-11-06T11:44:22",
"date_modified": "2019-11-06T13:44:22",
"date_modified_gmt": "2019-11-06T11:44:22",
"src": "https://example.com/wp-content/uploads/2019/11/T_3_back-20.jpg",
"name": "T_3_back-20.jpg",
"alt": ""
}
],
"attributes": [
{
"id": 6,
"name": "Color",
"position": 0,
"visible": false,
"variation": true,
"options": [
"Black",
"Green"
],
"option_ids": [
22,
24
]
},
{
"id": 0,
"name": "Size",
"position": 1,
"visible": true,
"variation": true,
"options": [
"S",
"M"
],
"option_ids": [
"S",
"M"
]
}
],
"default_attributes": [
{
"id": 6,
"name": "Color",
"option": "black"
},
{
"id": 0,
"name": "Size",
"option": "S"
}
],
"variations": [],
"grouped_products": [],
"menu_order": 0,
"meta_data": [],
"purchase_price": 0,
"supplier_id": 0,
"supplier_sku": "",
"barcode": "",
"atum_controlled": false,
"out_stock_date": null,
"out_stock_threshold": 0,
"inheritable": false,
"inbound_stock": null,
"stock_on_hold": null,
"sold_today": null,
"sales_last_days": null,
"reserved_stock": null,
"customer_returns": null,
"warehouse_damage": null,
"lost_in_post": null,
"other_logs": null,
"out_stock_days": null,
"lost_sales": null,
"has_location": null,
"update_date": "2019-11-06T10:44:23",
"atum_locations": [],
"atum_stock_status": "outofstock",
"restock_status": false,
"sales_update_date": "2019-11-06T10:44:23",
"calc_backorders": null,
"linked_bom": [],
"sync_purchase_price": false,
"bom_sellable": false,
"minimum_threshold": null,
"available_to_purchase": null,
"selling_priority": null,
"calculated_stock": null,
"is_bom": true,
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/products/2101"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products"
}
]
}
}Retrieve a product
This API lets you retrieve and view a specific product by ID.
HTTP request
/wp-json/wc/v3/products/<id>curl https://example.com/wp-json/wc/v3/products/70 \
-u consumer_key:consumer_secret{
"id": 70,
"name": "Flying Ninja",
"slug": "flying-ninja",
"permalink": "https://example.com/product/flying-ninja/",
"date_created": "2013-06-07T13:25:01",
"date_created_gmt": "2013-06-07T11:25:01",
"date_modified": "2019-10-25T11:57:08",
"date_modified_gmt": "2019-10-25T09:57:08",
"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>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",
"sku": "",
"price": "50",
"regular_price": "50",
"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": "",
"on_sale": false,
"purchasable": false,
"total_sales": 54,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"external_url": "",
"button_text": "",
"tax_status": "taxable",
"tax_class": "",
"manage_stock": true,
"stock_quantity": 229,
"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": "4.00",
"rating_count": 4,
"related_ids": [
76,
73,
175,
79,
507
],
"upsell_ids": [],
"cross_sell_ids": [],
"parent_id": 0,
"purchase_note": "",
"categories": [
{
"id": 12,
"name": "Posters",
"slug": "posters"
}
],
"tags": [],
"images": [
{
"id": 71,
"date_created": "2013-06-07T13:24:19",
"date_created_gmt": "2013-06-07T11:24:19",
"date_modified": "2013-06-07T13:24:19",
"date_modified_gmt": "2013-06-07T11:24:19",
"src": "https://example.com/wp-content/uploads/2013/06/poster_2_up.jpg",
"name": "poster_2_up",
"alt": ""
},
{
"id": 72,
"date_created": "2013-06-07T13:24:47",
"date_created_gmt": "2013-06-07T11:24:47",
"date_modified": "2013-06-07T13:24:47",
"date_modified_gmt": "2013-06-07T11:24:47",
"src": "https://example.com/wp-content/uploads/2013/06/Poster_2_flat.jpg",
"name": "Poster_2_flat",
"alt": ""
}
],
"attributes": [],
"default_attributes": [],
"variations": [],
"grouped_products": [],
"menu_order": 0,
"meta_data": [],
"purchase_price": 9,
"supplier_id": 399,
"supplier_sku": "",
"barcode": "",
"atum_controlled": true,
"out_stock_date": null,
"out_stock_threshold": 0,
"inheritable": false,
"inbound_stock": 1,
"stock_on_hold": 48,
"sold_today": 0,
"sales_last_days": 0,
"reserved_stock": 0,
"customer_returns": 0,
"warehouse_damage": 0,
"lost_in_post": 0,
"other_logs": 0,
"out_stock_days": 0,
"lost_sales": 0,
"has_location": true,
"update_date": "2019-10-25T06:25:24",
"atum_locations": [
{
"id": 39,
"name": "Italy",
"slug": "italy"
},
{
"id": 50,
"name": "Madrid",
"slug": "madrid"
},
{
"id": 37,
"name": "Spain",
"slug": "spain"
},
{
"id": 38,
"name": "United Kingdom",
"slug": "united-kingdom"
},
{
"id": 49,
"name": "Valencia",
"slug": "valencia"
}
],
"atum_stock_status": "instock",
"restock_status": false,
"sales_update_date": "2019-10-25T06:25:24",
"calc_backorders": 0,
"linked_bom": [
{
"bom_id": 183,
"bom_type": "raw_material",
"qty": 2,
"measure_unit": null
}
],
"sync_purchase_price": false,
"calculated_stock": 229,
"is_bom": false,
"mi_inventories": [],
"multi_inventory": "global",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/products/70"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products"
}
]
}
}List all products
This API helps you to view all the products.
HTTP request
/wp-json/wc/v3/productscurl https://example.com/wp-json/wc/v3/products \
-u consumer_key:consumer_secret[
{
"id": 507,
"name": "ABC 123 XPTO",
"slug": "abc-123-xpto",
"permalink": "https://example.com/product/abc-123-xpto/",
"date_created": "2018-12-28T08:21:22",
"date_created_gmt": "2018-12-28T07:21:22",
"date_modified": "2019-10-22T13:34:08",
"date_modified_gmt": "2019-10-22T11:34:08",
"type": "simple",
"status": "publish",
"featured": false,
"catalog_visibility": "visible",
"description": "",
"short_description": "",
"sku": "",
"price": null,
"regular_price": null,
"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": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">€</span>5,32</span> – <span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">€</span>20,00</span>",
"on_sale": false,
"purchasable": true,
"total_sales": 58,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"external_url": "",
"button_text": "",
"tax_status": "taxable",
"tax_class": "",
"manage_stock": true,
"stock_quantity": 0,
"stock_status": "outofstock",
"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": [
70,
76,
79,
175,
67
],
"upsell_ids": [],
"cross_sell_ids": [],
"parent_id": 0,
"purchase_note": "",
"categories": [
{
"id": 12,
"name": "Posters",
"slug": "posters"
}
],
"tags": [],
"images": [],
"attributes": [],
"default_attributes": [],
"variations": [],
"grouped_products": [],
"menu_order": 0,
"meta_data": [],
"purchase_price": 2,
"supplier_id": 399,
"supplier_sku": "CRYPTO",
"barcode": "BBBBBAAAAA",
"atum_controlled": true,
"out_stock_date": "2019-09-26T07:06:23",
"out_stock_threshold": 0,
"inheritable": false,
"inbound_stock": 6,
"stock_on_hold": 39,
"sold_today": 0,
"sales_last_days": 2,
"reserved_stock": 2,
"customer_returns": 0,
"warehouse_damage": 0,
"lost_in_post": 3,
"other_logs": 1,
"out_stock_days": 34,
"lost_sales": 0,
"has_location": false,
"update_date": null,
"atum_locations": [],
"atum_stock_status": "outofstock",
"restock_status": false,
"sales_update_date": null,
"calc_backorders": 0,
"linked_bom": [],
"sync_purchase_price": false,
"is_bom": false,
"mi_inventories": [
152,
55,
126
],
"multi_inventory": "yes",
"inventory_sorting_mode": "global",
"inventory_iteration": "global",
"expirable_inventories": "global",
"price_per_inventory": "global",
"show_write_off_inventories": "global",
"selectable_inventories": "global",
"selectable_inventories_mode": "global",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/products/507"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products"
}
]
}
},
{
"id": 90,
"name": "Woo Album #3",
"slug": "woo-album-3",
"permalink": "https://example.com/product/woo-album-3/",
"date_created": "2013-06-07T13:35:18",
"date_created_gmt": "2013-06-07T11:35:18",
"date_modified": "2019-10-30T11:50:51",
"date_modified_gmt": "2019-10-30T10:50:51",
"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<p> </p>\n<div class=\"atum-mi-no-info\">This product has no inventory info available.</div>\n",
"short_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",
"sku": "WOO3",
"price": null,
"regular_price": null,
"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": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">€</span>10,00</span> – <span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">€</span>15,70</span>",
"on_sale": false,
"purchasable": true,
"total_sales": 137,
"virtual": false,
"downloadable": true,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"external_url": "",
"button_text": "",
"tax_status": "taxable",
"tax_class": "",
"manage_stock": true,
"stock_quantity": 0,
"stock_status": "outofstock",
"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": false,
"average_rating": "3.00",
"rating_count": 1,
"related_ids": [
99,
96,
669,
83,
649
],
"upsell_ids": [],
"cross_sell_ids": [],
"parent_id": 0,
"purchase_note": "",
"categories": [
{
"id": 15,
"name": "Albums",
"slug": "albums"
},
{
"id": 11,
"name": "Music",
"slug": "music"
}
],
"tags": [],
"images": [
{
"id": 91,
"date_created": "2013-06-07T13:34:58",
"date_created_gmt": "2013-06-07T11:34:58",
"date_modified": "2013-06-07T13:34:58",
"date_modified_gmt": "2013-06-07T11:34:58",
"src": "https://example.com/wp-content/uploads/2013/06/cd_3_angle.jpg",
"name": "cd_3_angle",
"alt": ""
},
{
"id": 92,
"date_created": "2013-06-07T13:35:10",
"date_created_gmt": "2013-06-07T11:35:10",
"date_modified": "2013-06-07T13:35:10",
"date_modified_gmt": "2013-06-07T11:35:10",
"src": "https://example.com/wp-content/uploads/2013/06/cd_3_flat.jpg",
"name": "cd_3_flat",
"alt": ""
}
],
"attributes": [],
"default_attributes": [],
"variations": [],
"grouped_products": [],
"menu_order": 0,
"meta_data": [
{
"id": 1390,
"key": "_download_type",
"value": ""
},
{
"id": 10290,
"key": "_bom_stock_control",
"value": "advanced"
}
],
"purchase_price": 6,
"supplier_id": 399,
"supplier_sku": "SUPSK1",
"barcode": "XXXXXVVVVV",
"atum_controlled": true,
"out_stock_date": "2019-10-25T10:32:12",
"out_stock_threshold": 0,
"inheritable": false,
"inbound_stock": 5,
"stock_on_hold": 39,
"sold_today": 0,
"sales_last_days": 0,
"reserved_stock": 0,
"customer_returns": 0,
"warehouse_damage": 0,
"lost_in_post": 0,
"other_logs": 1,
"out_stock_days": 4,
"lost_sales": 0,
"has_location": true,
"update_date": null,
"atum_locations": [
{
"id": 39,
"name": "Italy",
"slug": "italy"
}
],
"atum_stock_status": "outofstock",
"restock_status": false,
"sales_update_date": null,
"calc_backorders": 0,
"linked_bom": [
{
"bom_id": 175,
"bom_type": "product_part",
"qty": 3,
"measure_unit": null
},
{
"bom_id": 182,
"bom_type": "raw_material",
"qty": 9,
"measure_unit": null
},
{
"bom_id": 184,
"bom_type": "product_part",
"qty": 35,
"measure_unit": null
}
],
"sync_purchase_price": true,
"calculated_stock": 0,
"is_bom": false,
"mi_inventories": [
1,
2,
5,
85,
3
],
"multi_inventory": "yes",
"inventory_sorting_mode": "global",
"inventory_iteration": "global",
"expirable_inventories": "global",
"price_per_inventory": "global",
"show_write_off_inventories": "global",
"selectable_inventories": "global",
"selectable_inventories_mode": "global",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/products/90"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products"
}
]
}
}
]Available parameters
| Parameter | Type | Description |
|---|---|---|
context | string | Scope under which the request is made; determines fields present in response. Options: view and edit. Default is view. |
page | integer | Current page of the collection. Default is 1. |
per_page | integer | Maximum number of items to be returned in result set. Default is 10. |
search | string | Limit results to those matching a string. |
after | string | Limit response to resources published after a given ISO8601 compliant date. |
before | string | Limit response to resources published before a given ISO8601 compliant date. |
modified_after | string | Limit response to resources modified after a given ISO8601 compliant date. |
modified_before | string | Limit response to resources modified before a given ISO8601 compliant date. |
dates_are_gmt | boolean | Whether to consider GMT post dates when limiting response by published or modified date. Default is false. |
exclude | array | Ensure result set excludes specific IDs. |
include | array | Limit result set to specific ids. |
offset | integer | Offset the result set by a specific number of items. |
order | string | Order sort attribute ascending or descending. Options: asc and desc. Default is desc. |
orderby | string | Sort collection by object attribute. Options: date, id, include, title and slug. Default is date. |
parent | array | Limit result set to those of particular parent IDs. |
parent_exclude | array | Limit result set to all items except those of a particular parent ID. |
slug | string | Limit result set to products with a specific slug. |
status | string | Limit result set to products assigned a specific status. Options: any, draft, pending, private and publish. Default is any. |
atum_post_status | string | Limit result set to products with the specified post statuses. Multiple statuses can be passed separated by commas (e.g. publish,private). When used, it replaces the status filter. If private is included, the filter is only applied for users that can read private posts. ATUM |
type | string | Limit result set to products assigned a specific type. Options: simple, grouped, external, variable, product-part, raw-material, variable-product-part and variable-raw-material. |
sku | string | Limit result set to products with a specific SKU. |
featured | boolean | Limit result set to featured products. |
category | string | Limit result set to products assigned a specific category ID. |
tag | string | Limit result set to products assigned a specific tag ID. |
shipping_class | string | Limit result set to products assigned a specific shipping class ID. |
attribute | string | Limit result set to products with a specific attribute. |
attribute_term | string | Limit result set to products with a specific attribute term ID (required an assigned attribute). |
tax_class | string | Limit result set to products with a specific tax class. Default options: standard, reduced-rate and zero-rate. |
on_sale | boolean | Limit result set to products on sale. |
min_price | string | Limit result set to products based on a minimum price. |
max_price | string | Limit result set to products based on a maximum price. |
stock_status | string | Limit result set to products with specified stock status. Options: instock, outofstock and onbackorder. |
atum_location | string | Limit result set to products assigned to specific ATUM Location IDs. Multiple IDs can be passed separated by commas. ATUM |
atum_controlled | boolean | Limit result set to products controlled by ATUM. ATUM |
atum_min_purchase_price | number | Limit result set to products based on a minimum purchase price. ATUM |
atum_max_purchase_price | number | Limit result set to products based on a maximum purchase price. ATUM |
atum_supplier | integer | Limit result set to products linked to the specified Supplier ID. ATUM |
atum_supplier_sku | string | Limit result set to products with a specific Supplier SKU. ATUM |
atum_barcode | string | Limit result set to products with a specific barcode. ATUM |
atum_multi_inventory | string | Limit result set to products with a specific Multi-Inventory status. Options: yes, no and global. Multi-Inventory ATUM |
atum_inventory_sorting_mode | string | Limit result set to products with a specific inventory sorting mode. Options: fifo, lifo, bbe, manual and global. Multi-Inventory ATUM |
atum_inventory_iteration | string | Limit result set to products with a specific inventory iteration. Options: use_next, out_of_stock and global. Multi-Inventory ATUM |
atum_expirable_inventories | string | Limit result set to products with a specific expirable inventories option. Options: yes, no and global. Multi-Inventory ATUM |
atum_price_per_inventory | string | Limit result set to products with a specific price per inventory option. Options: yes, no and global. Multi-Inventory ATUM |
atum_show_write_off_inventories | string | Limit result set to products with a specific show written off inventories option. Options: yes and no. Multi-Inventory ATUM |
atum_selectable_inventories | string | Limit result set to products with a specific selectable inventories option. Options: yes, no and global. Multi-Inventory ATUM |
atum_selectable_inventories_mode | string | Limit result set to products with a specific selectable inventories mode option. Options: dropdown, list and global. Multi-Inventory ATUM |
atum_bom_sellable | boolean | Limit result set to sellable BOM products. It should be used in conjunction with the type set to any BOM type. Product Levels ATUM |
The atum_* filters (except atum_post_status) aren't declared as arguments of the endpoint, so they aren't validated and they aren't listed in its OPTIONS response, but they are applied to the query when they are sent.
Update a product
This API lets you make changes to a product.
HTTP request
/wp-json/wc/v3/products/<id>curl -X PUT https://example.com/wp-json/wc/v3/products/70 \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"purchase_price": 24.54
}'{
"id": 70,
"name": "Flying Ninja",
"slug": "flying-ninja",
"permalink": "https://example.com/product/flying-ninja/",
"date_created": "2013-06-07T13:25:01",
"date_created_gmt": "2013-06-07T11:25:01",
"date_modified": "2019-11-07T12:54:35",
"date_modified_gmt": "2019-11-07T11:54:35",
"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>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",
"sku": "",
"price": "50",
"regular_price": "50",
"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": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">€</span>50,00</span>",
"on_sale": false,
"purchasable": true,
"total_sales": 54,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"external_url": "",
"button_text": "",
"tax_status": "taxable",
"tax_class": "",
"manage_stock": true,
"stock_quantity": 229,
"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": "4.00",
"rating_count": 4,
"related_ids": [
507,
76,
73,
175,
67
],
"upsell_ids": [],
"cross_sell_ids": [],
"parent_id": 0,
"purchase_note": "",
"categories": [
{
"id": 12,
"name": "Posters",
"slug": "posters"
}
],
"tags": [],
"images": [
{
"id": 71,
"date_created": "2013-06-07T13:24:19",
"date_created_gmt": "2013-06-07T11:24:19",
"date_modified": "2013-06-07T13:24:19",
"date_modified_gmt": "2013-06-07T11:24:19",
"src": "https://example.com/wp-content/uploads/2013/06/poster_2_up.jpg",
"name": "poster_2_up",
"alt": ""
},
{
"id": 72,
"date_created": "2013-06-07T13:24:47",
"date_created_gmt": "2013-06-07T11:24:47",
"date_modified": "2013-06-07T13:24:47",
"date_modified_gmt": "2013-06-07T11:24:47",
"src": "https://example.com/wp-content/uploads/2013/06/Poster_2_flat.jpg",
"name": "Poster_2_flat",
"alt": ""
}
],
"attributes": [],
"default_attributes": [],
"variations": [],
"grouped_products": [],
"menu_order": 0,
"meta_data": [],
"purchase_price": 24.54,
"supplier_id": 399,
"supplier_sku": "",
"barcode": "",
"atum_controlled": true,
"out_stock_date": null,
"out_stock_threshold": 0,
"inheritable": false,
"inbound_stock": 1,
"stock_on_hold": 48,
"sold_today": 0,
"sales_last_days": 0,
"reserved_stock": 0,
"customer_returns": 0,
"warehouse_damage": 0,
"lost_in_post": 0,
"other_logs": 0,
"out_stock_days": 0,
"lost_sales": 0,
"has_location": true,
"update_date": "2019-11-07T10:54:37",
"atum_locations": [
{
"id": 39,
"name": "Italy",
"slug": "italy"
},
{
"id": 50,
"name": "Madrid",
"slug": "madrid"
},
{
"id": 37,
"name": "Spain",
"slug": "spain"
},
{
"id": 38,
"name": "United Kingdom",
"slug": "united-kingdom"
},
{
"id": 49,
"name": "Valencia",
"slug": "valencia"
}
],
"atum_stock_status": "instock",
"restock_status": false,
"sales_update_date": "2019-11-07T10:54:37",
"calc_backorders": 0,
"linked_bom": [
{
"bom_id": 183,
"bom_type": "raw_material",
"qty": 2,
"measure_unit": null
}
],
"sync_purchase_price": false,
"calculated_stock": 229,
"is_bom": false,
"mi_inventories": [
62
],
"multi_inventory": "global",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/products/70"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products"
}
]
}
}Delete a product
This API helps you delete a product.
HTTP request
/wp-json/wc/v3/products/<id>curl -X DELETE https://example.com/wp-json/wc/v3/products/1998?force=true \
-u consumer_key:consumer_secret{
"id": 1998,
"name": "ATUM Test Product",
"slug": "atum-test-product",
"permalink": "https://example.com/product/atum-test-product/",
"date_created": "2019-11-06T08:54:04",
"date_created_gmt": "2019-11-06T07:54:04",
"date_modified": "2019-11-07T13:00:07",
"date_modified_gmt": "2019-11-07T12:00:07",
"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.",
"short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
"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": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">€</span>21,99</span>",
"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",
"rating_count": 0,
"related_ids": [
34,
50,
37,
115,
103
],
"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": 1996,
"date_created": "2019-11-06T09:54:03",
"date_created_gmt": "2019-11-06T07:54:03",
"date_modified": "2019-11-06T09:54:03",
"date_modified_gmt": "2019-11-06T07:54:03",
"src": "https://example.com/wp-content/uploads/2019/11/T_2_front-8.jpg",
"name": "T_2_front-8.jpg",
"alt": ""
},
{
"id": 1997,
"date_created": "2019-11-06T09:54:04",
"date_created_gmt": "2019-11-06T07:54:04",
"date_modified": "2019-11-06T09:54:04",
"date_modified_gmt": "2019-11-06T07:54:04",
"src": "https://example.com/wp-content/uploads/2019/11/T_2_back-8.jpg",
"name": "T_2_back-8.jpg",
"alt": ""
}
],
"attributes": [],
"default_attributes": [],
"variations": [],
"grouped_products": [],
"menu_order": 0,
"meta_data": [],
"purchase_price": 15.2,
"supplier_id": 399,
"supplier_sku": "TEST1",
"barcode": "AAAAAABBBBBB",
"atum_controlled": true,
"out_stock_date": null,
"out_stock_threshold": 0,
"inheritable": false,
"inbound_stock": 0,
"stock_on_hold": 0,
"sold_today": 0,
"sales_last_days": 0,
"reserved_stock": 0,
"customer_returns": 0,
"warehouse_damage": 0,
"lost_in_post": 0,
"other_logs": 0,
"out_stock_days": 0,
"lost_sales": 0,
"has_location": true,
"update_date": "2019-11-07T07:40:51",
"atum_locations": [
{
"id": 39,
"name": "Italy",
"slug": "italy"
},
{
"id": 37,
"name": "Spain",
"slug": "spain"
}
],
"atum_stock_status": "instock",
"restock_status": false,
"sales_update_date": "2019-11-07T07:40:51",
"calc_backorders": null,
"linked_bom": [
{
"bom_id": 175,
"bom_type": "product_part",
"qty": 3,
"measure_unit": null
}
],
"sync_purchase_price": false,
"calculated_stock": 117,
"is_bom": false,
"mi_inventories": [
174
],
"multi_inventory": "global",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/products/1998"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products"
}
]
}
}Available parameters
| Parameter | Type | Description |
|---|---|---|
force | string | Use true whether to permanently delete the product, Default is false. |
Batch update products
This API helps you to batch create, update and delete multiple products.
Note: By default it's limited to up to 100 objects to be created, updated or deleted.
HTTP request
/wp-json/wc/v3/products/batchcurl -X POST https://example.com/wp-json/wc/v3/products/batch \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"create": [
{
"name": "TEST Batch Product",
"type": "simple",
"regular_price": "21.99",
"virtual": true,
"downloadable": true,
"downloads": [
{
"name": "Woo Single",
"file": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg"
}
],
"categories": [
{
"id": 11
},
{
"id": 13
}
],
"images": [
{
"src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg"
}
]
},
{
"name": "TEST Batch BOM Product",
"type": "raw-material",
"regular_price": "21.99",
"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.",
"short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
"categories": [
{
"id": 9
},
{
"id": 14
}
],
"images": [
{
"src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
},
{
"src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg"
}
]
}
],
"update": [
{
"id": 507,
"linked_bom": [
{
"bom_id": 183,
"bom_type": "raw_material",
"qty": 2
},
{
"bom_id": 184,
"bom_type": "product_part",
"qty": 1
}
],
"multi_inventory": "no"
}
],
"delete": [
2121
]
}'{
"create": [
{
"id": 2123,
"name": "TEST Batch Product",
"slug": "test-batch-product",
"permalink": "https://example.com/product/test-batch-product/",
"date_created": "2019-11-07T13:16:32",
"date_created_gmt": "2019-11-07T12:16:32",
"date_modified": "2019-11-07T13:16:32",
"date_modified_gmt": "2019-11-07T12:16:32",
"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": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">€</span>21,99</span>",
"on_sale": false,
"purchasable": true,
"total_sales": 0,
"virtual": true,
"downloadable": true,
"downloads": [
{
"id": "0e47b414-0469-4c6a-9ded-f2a8ea0b6ca4",
"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": false,
"shipping_class": "",
"shipping_class_id": 0,
"reviews_allowed": true,
"average_rating": "0",
"rating_count": 0,
"related_ids": [
649,
83,
90,
87,
96
],
"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": 2122,
"date_created": "2019-11-07T14:16:31",
"date_created_gmt": "2019-11-07T12:16:31",
"date_modified": "2019-11-07T14:16:31",
"date_modified_gmt": "2019-11-07T12:16:31",
"src": "https://example.com/wp-content/uploads/2019/11/cd_4_angle-1.jpg",
"name": "cd_4_angle-1.jpg",
"alt": ""
}
],
"attributes": [],
"default_attributes": [],
"variations": [],
"grouped_products": [],
"menu_order": 0,
"meta_data": [],
"purchase_price": 0,
"supplier_id": 0,
"supplier_sku": "",
"barcode": "",
"atum_controlled": false,
"out_stock_date": null,
"out_stock_threshold": 0,
"inheritable": false,
"inbound_stock": null,
"stock_on_hold": null,
"sold_today": null,
"sales_last_days": null,
"reserved_stock": null,
"customer_returns": null,
"warehouse_damage": null,
"lost_in_post": null,
"other_logs": null,
"out_stock_days": null,
"lost_sales": null,
"has_location": null,
"update_date": "2019-11-07T11:16:32",
"atum_locations": [],
"atum_stock_status": "instock",
"restock_status": false,
"sales_update_date": "2019-11-07T11:16:32",
"calc_backorders": null,
"linked_bom": [],
"sync_purchase_price": false,
"is_bom": false,
"mi_inventories": [],
"multi_inventory": "global",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/products/2123"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products"
}
]
}
},
{
"id": 2126,
"name": "TEST Batch BOM Product",
"slug": "test-batch-bom-product",
"permalink": "https://example.com/product/test-batch-bom-product/",
"date_created": "2019-11-07T13:16:34",
"date_created_gmt": "2019-11-07T12:16:34",
"date_modified": "2019-11-07T13:16:34",
"date_modified_gmt": "2019-11-07T12:16:34",
"type": "raw-material",
"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.",
"short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
"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": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">€</span>21,99</span>",
"on_sale": false,
"purchasable": false,
"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": true,
"stock_quantity": null,
"stock_status": "outofstock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"sold_individually": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_required": false,
"shipping_taxable": false,
"shipping_class": "",
"shipping_class_id": 0,
"reviews_allowed": true,
"average_rating": "0",
"rating_count": 0,
"related_ids": [
31,
103,
19,
56,
115
],
"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": 2124,
"date_created": "2019-11-07T14:16:33",
"date_created_gmt": "2019-11-07T12:16:33",
"date_modified": "2019-11-07T14:16:33",
"date_modified_gmt": "2019-11-07T12:16:33",
"src": "https://example.com/wp-content/uploads/2019/11/T_2_front-12.jpg",
"name": "T_2_front-12.jpg",
"alt": ""
},
{
"id": 2125,
"date_created": "2019-11-07T14:16:33",
"date_created_gmt": "2019-11-07T12:16:33",
"date_modified": "2019-11-07T14:16:33",
"date_modified_gmt": "2019-11-07T12:16:33",
"src": "https://example.com/wp-content/uploads/2019/11/T_2_back-12.jpg",
"name": "T_2_back-12.jpg",
"alt": ""
}
],
"attributes": [],
"default_attributes": [],
"variations": [],
"grouped_products": [],
"menu_order": 0,
"meta_data": [],
"purchase_price": 0,
"supplier_id": 0,
"supplier_sku": "",
"barcode": "",
"atum_controlled": false,
"out_stock_date": null,
"out_stock_threshold": 0,
"inheritable": false,
"inbound_stock": null,
"stock_on_hold": null,
"sold_today": null,
"sales_last_days": null,
"reserved_stock": null,
"customer_returns": null,
"warehouse_damage": null,
"lost_in_post": null,
"other_logs": null,
"out_stock_days": null,
"lost_sales": null,
"has_location": null,
"update_date": "2019-11-07T11:16:34",
"atum_locations": [],
"atum_stock_status": "outofstock",
"restock_status": false,
"sales_update_date": "2019-11-07T11:16:34",
"calc_backorders": 0,
"linked_bom": [],
"sync_purchase_price": false,
"bom_sellable": null,
"minimum_threshold": null,
"available_to_purchase": null,
"selling_priority": null,
"calculated_stock": null,
"is_bom": true,
"mi_inventories": [],
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/products/2126"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products"
}
]
}
}
],
"update": [
{
"id": 507,
"name": "ABC 123 XPTO",
"slug": "abc-123-xpto",
"permalink": "https://example.com/product/abc-123-xpto/",
"date_created": "2018-12-28T08:21:22",
"date_created_gmt": "2018-12-28T07:21:22",
"date_modified": "2019-11-07T13:16:35",
"date_modified_gmt": "2019-11-07T12:16:35",
"type": "simple",
"status": "publish",
"featured": false,
"catalog_visibility": "visible",
"description": "",
"short_description": "",
"sku": "",
"price": "5.32",
"regular_price": "5.32",
"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": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">€</span>5,32</span> – <span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">€</span>20,00</span>",
"on_sale": false,
"purchasable": true,
"total_sales": 58,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"external_url": "",
"button_text": "",
"tax_status": "taxable",
"tax_class": "",
"manage_stock": true,
"stock_quantity": null,
"stock_status": "outofstock",
"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",
"rating_count": 0,
"related_ids": [
79,
70,
73,
175,
76
],
"upsell_ids": [],
"cross_sell_ids": [],
"parent_id": 0,
"purchase_note": "",
"categories": [
{
"id": 12,
"name": "Posters",
"slug": "posters"
}
],
"tags": [],
"images": [],
"attributes": [],
"default_attributes": [],
"variations": [],
"grouped_products": [],
"menu_order": 0,
"meta_data": [],
"purchase_price": 2,
"supplier_id": 399,
"supplier_sku": "CRYPTO",
"barcode": "BBBBBAAAAA",
"atum_controlled": true,
"out_stock_date": "2019-09-26T07:06:23",
"out_stock_threshold": 0,
"inheritable": false,
"inbound_stock": 6,
"stock_on_hold": 39,
"sold_today": 0,
"sales_last_days": 2,
"reserved_stock": 2,
"customer_returns": 0,
"warehouse_damage": 0,
"lost_in_post": 3,
"other_logs": 1,
"out_stock_days": 34,
"lost_sales": 0,
"has_location": false,
"update_date": "2019-11-07T08:40:50",
"atum_locations": [],
"atum_stock_status": "outofstock",
"restock_status": false,
"sales_update_date": "2019-11-07T08:40:50",
"calc_backorders": 0,
"linked_bom": [
{
"bom_id": 183,
"bom_type": "raw_material",
"qty": 2,
"measure_unit": null
},
{
"bom_id": 184,
"bom_type": "product_part",
"qty": 1,
"measure_unit": null
}
],
"sync_purchase_price": false,
"is_bom": false,
"mi_inventories": [
152,
55,
126
],
"multi_inventory": "no",
"inventory_sorting_mode": "global",
"inventory_iteration": "use_next",
"expirable_inventories": "no",
"price_per_inventory": "yes",
"show_write_off_inventories": "global",
"selectable_inventories": "global",
"selectable_inventories_mode": "global",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/products/507"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products"
}
]
}
}
],
"delete": [
{
"id": 2121,
"name": "ATUM Test Product",
"slug": "atum-test-product",
"permalink": "https://example.com/product/atum-test-product/",
"date_created": "2019-11-07T13:11:59",
"date_created_gmt": "2019-11-07T12:11:59",
"date_modified": "2019-11-07T13:12:29",
"date_modified_gmt": "2019-11-07T12:12:29",
"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.",
"short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
"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": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">€</span>21,99</span>",
"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",
"rating_count": 0,
"related_ids": [
50,
15,
19,
31,
40
],
"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": 2119,
"date_created": "2019-11-07T14:11:58",
"date_created_gmt": "2019-11-07T12:11:58",
"date_modified": "2019-11-07T14:11:58",
"date_modified_gmt": "2019-11-07T12:11:58",
"src": "https://example.com/wp-content/uploads/2019/11/T_2_front-11.jpg",
"name": "T_2_front-11.jpg",
"alt": ""
},
{
"id": 2120,
"date_created": "2019-11-07T14:11:58",
"date_created_gmt": "2019-11-07T12:11:58",
"date_modified": "2019-11-07T14:11:58",
"date_modified_gmt": "2019-11-07T12:11:58",
"src": "https://example.com/wp-content/uploads/2019/11/T_2_back-11.jpg",
"name": "T_2_back-11.jpg",
"alt": ""
}
],
"attributes": [],
"default_attributes": [],
"variations": [],
"grouped_products": [],
"menu_order": 0,
"meta_data": [],
"purchase_price": 15.2,
"supplier_id": 399,
"supplier_sku": "TEST1",
"barcode": "AAAAAABBBBBB",
"atum_controlled": true,
"out_stock_date": null,
"out_stock_threshold": 0,
"inheritable": false,
"inbound_stock": null,
"stock_on_hold": null,
"sold_today": null,
"sales_last_days": null,
"reserved_stock": null,
"customer_returns": null,
"warehouse_damage": null,
"lost_in_post": null,
"other_logs": null,
"out_stock_days": null,
"lost_sales": null,
"has_location": null,
"update_date": "2019-11-07T11:12:29",
"atum_locations": [
{
"id": 39,
"name": "Italy",
"slug": "italy"
},
{
"id": 37,
"name": "Spain",
"slug": "spain"
}
],
"atum_stock_status": "instock",
"restock_status": false,
"sales_update_date": "2019-11-07T11:12:29",
"calc_backorders": null,
"linked_bom": [
{
"bom_id": 175,
"bom_type": "product_part",
"qty": 3,
"measure_unit": null
}
],
"sync_purchase_price": false,
"calculated_stock": 117,
"is_bom": false,
"mi_inventories": [
180
],
"multi_inventory": "global",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/products/2121"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products"
}
]
}
}
]
}