Product variations
This endpoint is an extension of the official WC's product variations endpoint with extra info added by ATUM and/or its add-ons. You can identify the ATUM data with the corresponding labels.
The product variations API allows you to create, view, update, and delete individual, or a batch, of product variations. ATUM also adds its own endpoints to list all the variations and to batch update any variations, no matter their parent products.
The ATUM fields are only exposed through the WooCommerce REST API (/wp-json/wc/v3) and they follow the same module and capability requirements explained in the Products page.
Product variation properties
| Attribute | Type | Description |
|---|---|---|
id | integer | Unique identifier for the resource. read-only |
date_created | date-time | The date the variation was created, in the site's timezone. read-only |
date_created_gmt | date-time | The date the variation was created, as GMT. read-only |
date_modified | date-time | The date the variation was last modified, in the site's timezone. read-only |
date_modified_gmt | date-time | The date the variation was last modified, as GMT. read-only |
description | string | Variation description. |
permalink | string | Variation URL. read-only |
sku | string | Unique identifier. |
price | string | Current variation price. read-only |
regular_price | string | Variation regular price. |
sale_price | string | Variation 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. |
on_sale | boolean | Shows if the variation is on sale. read-only |
status | string | Variation status. Options: draft, pending, private and publish. Default is publish. |
purchasable | boolean | Shows if the variation can be bought. read-only |
virtual | boolean | If the variation is virtual. Default is false. |
downloadable | boolean | If the variation is downloadable. Default is false. |
downloads | array | List of downloadable files. See Product variation - 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. |
tax_status | string | Tax status. Options: taxable, shipping and none. Default is taxable. |
tax_class | string | Tax class. |
manage_stock | boolean | Stock management at variation 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 variation is on backordered. read-only |
weight | string | Variation weight. |
dimensions | object | Variation dimensions. See Product variation - Dimensions properties |
shipping_class | string | Shipping class slug. |
shipping_class_id | string | Shipping class ID. read-only |
image | object | Variation image data. See Product variation - Image properties |
attributes | array | List of attributes. See Product variation - Attributes properties |
menu_order | integer | Menu order, used to custom sort products. |
meta_data | array | Meta data. See Product variation - 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 |
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 |
update_date | date-time | Last date when the ATUM product data was calculated and saved for this product. 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 variation. It is only filled when the variation has Multi-Inventory enabled. 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 variation - 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 variations whose type isn't compatible with Multi-Inventory, and only mi_inventories and multi_inventory are returned when the variation doesn't have Multi-Inventory enabled.
When a variation 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 variation - Downloads properties
| Attribute | Type | Description |
|---|---|---|
id | string | File ID. |
name | string | File name. |
file | string | File URL. |
Product variation - Dimensions properties
| Attribute | Type | Description |
|---|---|---|
length | string | Variation length. |
width | string | Variation width. |
height | string | Variation height. |
Product variation - Image 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 variation - Attributes properties
| Attribute | Type | Description |
|---|---|---|
id | integer | Attribute ID. |
name | string | Attribute name. |
option | string | Selected attribute term name. |
Product variation - Meta data properties
| Attribute | Type | Description |
|---|---|---|
id | integer | Meta ID. read-only |
key | string | Meta key. |
value | string | Meta value. |
Product variation - 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 variation
This API helps you to create a new product variation.
HTTP request
/wp-json/wc/v3/products/<product_id>/variationsJSON response example
curl -X POST https://example.com/wp-json/wc/v3/products/22/variations \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"regular_price": "9.00",
"purchase_price": 6.5,
"atum_controlled": true,
"image": {
"id": 48
},
"attributes": [
{
"id": 1,
"name": "color",
"option": "Purple"
}
]
}'{
"id": 2131,
"date_created": "2019-11-08T09:00:34",
"date_created_gmt": "2019-11-08T08:00:34",
"date_modified": "2019-11-08T09:00:34",
"date_modified_gmt": "2019-11-08T08:00:34",
"description": "",
"permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=purple",
"sku": "",
"price": "9.00",
"regular_price": "9.00",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"status": "publish",
"purchasable": true,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"tax_status": "taxable",
"tax_class": "",
"manage_stock": "parent",
"stock_quantity": 0,
"stock_status": "instock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_class": "",
"shipping_class_id": 0,
"image": {
"id": 48,
"date_created": "2013-06-07T13:01:23",
"date_created_gmt": "2013-06-07T11:01:23",
"date_modified": "2013-06-07T13:01:23",
"date_modified_gmt": "2013-06-07T11:01:23",
"src": "https://example.com/wp-content/uploads/2013/06/hoodie_2_front.jpg",
"name": "hoodie_2_front",
"alt": ""
},
"attributes": [
{
"id": 1,
"name": "color",
"option": "Purple"
}
],
"menu_order": 0,
"meta_data": [],
"purchase_price": 6.5,
"supplier_id": 0,
"supplier_sku": "",
"barcode": "",
"atum_controlled": true,
"out_stock_date": null,
"out_stock_threshold": 0,
"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,
"update_date": "2019-11-08T07:00:34",
"atum_stock_status": "instock",
"restock_status": false,
"sales_update_date": "2019-11-08T07:00:34",
"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/22/variations/2131"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products/22/variations"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/products/22"
}
]
}
}Retrieve a product variation
This API lets you retrieve and view a specific product variation by ID.
HTTP request
/wp-json/wc/v3/products/<product_id>/variations/<id>curl https://example.com/wp-json/wc/v3/products/22/variations/23 \
-u consumer_key:consumer_secret{
"id": 23,
"date_created": "2013-06-07T12:44:57",
"date_created_gmt": "2013-06-07T10:44:57",
"date_modified": "2019-11-08T09:00:04",
"date_modified_gmt": "2019-11-08T08:00:04",
"description": "",
"permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=black",
"sku": "",
"price": "20",
"regular_price": "20",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"status": "publish",
"purchasable": true,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"tax_status": "taxable",
"tax_class": "",
"manage_stock": "parent",
"stock_quantity": 9,
"stock_status": "instock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_class": "",
"shipping_class_id": 0,
"image": {
"id": 29,
"date_created": "2013-06-07T12:45:30",
"date_created_gmt": "2013-06-07T10:45:30",
"date_modified": "2013-06-07T12:45:30",
"date_modified_gmt": "2013-06-07T10:45:30",
"src": "https://example.com/wp-content/uploads/2013/06/T_4_front1.jpg",
"name": "T_4_front",
"alt": ""
},
"attributes": [
{
"id": 1,
"name": "color",
"option": "Black"
}
],
"menu_order": 2,
"meta_data": [],
"purchase_price": 8,
"supplier_id": 399,
"supplier_sku": "",
"barcode": "",
"atum_controlled": true,
"out_stock_date": null,
"out_stock_threshold": 0,
"inbound_stock": 2,
"stock_on_hold": 3,
"sold_today": 0,
"sales_last_days": 2,
"reserved_stock": 0,
"customer_returns": 0,
"warehouse_damage": 0,
"lost_in_post": 0,
"other_logs": 0,
"out_stock_days": 0,
"lost_sales": 0,
"update_date": "2019-11-08T07:00:06",
"atum_stock_status": "instock",
"restock_status": false,
"sales_update_date": "2019-11-08T07:00:06",
"calc_backorders": null,
"linked_bom": [
{
"bom_id": 551,
"bom_type": "raw_material",
"qty": 1,
"measure_unit": null
}
],
"sync_purchase_price": false,
"calculated_stock": 9,
"is_bom": false,
"mi_inventories": [],
"multi_inventory": "no",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/products/22/variations/23"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products/22/variations"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/products/22"
}
]
}
}List all product variations
This API helps you to view all the product variations.
HTTP request
/wp-json/wc/v3/products/<product_id>/variationscurl https://example.com/wp-json/wc/v3/products/22/variations \
-u consumer_key:consumer_secret[
{
"id": 2131,
"date_created": "2019-11-08T09:00:34",
"date_created_gmt": "2019-11-08T08:00:34",
"date_modified": "2019-11-08T09:00:59",
"date_modified_gmt": "2019-11-08T08:00:59",
"description": "",
"permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=purple",
"sku": "",
"price": "9.00",
"regular_price": "9.00",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"status": "publish",
"purchasable": true,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"tax_status": "taxable",
"tax_class": "",
"manage_stock": "parent",
"stock_quantity": 0,
"stock_status": "outofstock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_class": "",
"shipping_class_id": 0,
"image": {
"id": 48,
"date_created": "2013-06-07T13:01:23",
"date_created_gmt": "2013-06-07T11:01:23",
"date_modified": "2013-06-07T13:01:23",
"date_modified_gmt": "2013-06-07T11:01:23",
"src": "https://example.com/wp-content/uploads/2013/06/hoodie_2_front.jpg",
"name": "hoodie_2_front",
"alt": ""
},
"attributes": [
{
"id": 1,
"name": "color",
"option": "Purple"
}
],
"menu_order": 0,
"meta_data": [],
"purchase_price": 6.5,
"supplier_id": 0,
"supplier_sku": "",
"barcode": "",
"atum_controlled": false,
"out_stock_date": null,
"out_stock_threshold": 0,
"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,
"update_date": "2019-11-08T07:00:59",
"atum_stock_status": "outofstock",
"restock_status": false,
"sales_update_date": "2019-11-08T07:00:59",
"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/22/variations/2131"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products/22/variations"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/products/22"
}
]
}
},
{
"id": 24,
"date_created": "2013-06-07T12:44:58",
"date_created_gmt": "2013-06-07T10:44:58",
"date_modified": "2019-11-08T09:00:06",
"date_modified_gmt": "2019-11-08T08:00:06",
"description": "",
"permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=green",
"sku": "",
"price": "20",
"regular_price": "20",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"status": "publish",
"purchasable": true,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"tax_status": "taxable",
"tax_class": "",
"manage_stock": true,
"stock_quantity": 4,
"stock_status": "instock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_class": "",
"shipping_class_id": 0,
"image": {
"id": 27,
"date_created": "2013-06-07T12:45:27",
"date_created_gmt": "2013-06-07T10:45:27",
"date_modified": "2013-06-07T12:45:27",
"date_modified_gmt": "2013-06-07T10:45:27",
"src": "https://example.com/wp-content/uploads/2013/06/T_3_front.jpg",
"name": "T_3_front",
"alt": ""
},
"attributes": [
{
"id": 1,
"name": "color",
"option": "Green"
}
],
"menu_order": 2,
"meta_data": [],
"purchase_price": 12,
"supplier_id": 386,
"supplier_sku": "",
"barcode": "",
"atum_controlled": true,
"out_stock_date": null,
"out_stock_threshold": 0,
"inbound_stock": 1,
"stock_on_hold": 0,
"sold_today": 0,
"sales_last_days": 0,
"reserved_stock": 0,
"customer_returns": 0,
"warehouse_damage": 0,
"lost_in_post": 1,
"other_logs": 1,
"out_stock_days": 0,
"lost_sales": 0,
"update_date": "2019-11-08T07:00:06",
"atum_stock_status": "instock",
"restock_status": false,
"sales_update_date": "2019-11-08T07:00:06",
"calc_backorders": 0,
"linked_bom": [],
"sync_purchase_price": false,
"is_bom": false,
"mi_inventories": [],
"multi_inventory": "no",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/products/22/variations/24"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products/22/variations"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/products/22"
}
]
}
},
{
"id": 23,
"date_created": "2013-06-07T12:44:57",
"date_created_gmt": "2013-06-07T10:44:57",
"date_modified": "2019-11-08T09:00:04",
"date_modified_gmt": "2019-11-08T08:00:04",
"description": "",
"permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=black",
"sku": "",
"price": "20",
"regular_price": "20",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"status": "publish",
"purchasable": true,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"tax_status": "taxable",
"tax_class": "",
"manage_stock": "parent",
"stock_quantity": 9,
"stock_status": "instock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_class": "",
"shipping_class_id": 0,
"image": {
"id": 29,
"date_created": "2013-06-07T12:45:30",
"date_created_gmt": "2013-06-07T10:45:30",
"date_modified": "2013-06-07T12:45:30",
"date_modified_gmt": "2013-06-07T10:45:30",
"src": "https://example.com/wp-content/uploads/2013/06/T_4_front1.jpg",
"name": "T_4_front",
"alt": ""
},
"attributes": [
{
"id": 1,
"name": "color",
"option": "Black"
}
],
"menu_order": 2,
"meta_data": [],
"purchase_price": 8,
"supplier_id": 399,
"supplier_sku": "",
"barcode": "",
"atum_controlled": true,
"out_stock_date": null,
"out_stock_threshold": 0,
"inbound_stock": 2,
"stock_on_hold": 3,
"sold_today": 0,
"sales_last_days": 2,
"reserved_stock": 0,
"customer_returns": 0,
"warehouse_damage": 0,
"lost_in_post": 0,
"other_logs": 0,
"out_stock_days": 0,
"lost_sales": 0,
"update_date": "2019-11-08T07:00:06",
"atum_stock_status": "instock",
"restock_status": false,
"sales_update_date": "2019-11-08T07:00:06",
"calc_backorders": null,
"linked_bom": [
{
"bom_id": 551,
"bom_type": "raw_material",
"qty": 1,
"measure_unit": null
}
],
"sync_purchase_price": false,
"calculated_stock": 9,
"is_bom": false,
"mi_inventories": [],
"multi_inventory": "no",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/products/22/variations/23"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products/22/variations"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/products/22"
}
]
}
}
]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 variations 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 |
sku | string | Limit result set to products with a specific SKU. |
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_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 variations. Product Levels ATUM |
List all variations
ATUMThis API helps you to view all the variations (no matter its parent product). Each variation includes its parent_id, so you can know which variable product it belongs to.
The results are always sorted by variation ID (the orderby param is ignored). The only argument declared by this endpoint is context, so the rest of params listed below aren't validated nor have default values, but they are applied to the query when they are sent. Pass the array params with the array syntax (e.g. parent[]=22).
HTTP request
/wp-json/wc/v3/atum/product-variationscurl https://example.com/wp-json/wc/v3/atum/product-variations \
-u consumer_key:consumer_secret[
{
"id": 2969,
"date_created": "2021-04-13T13:13:34",
"date_created_gmt": "2021-04-13T11:13:34",
"date_modified": "2021-04-13T13:20:12",
"date_modified_gmt": "2021-04-13T11:20:12",
"description": "",
"permalink": "http://example.com/product/testing-variation-fields/?attribute_pa_color=orange",
"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,
"on_sale": false,
"status": "publish",
"purchasable": false,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"tax_status": "taxable",
"tax_class": "",
"manage_stock": true,
"stock_quantity": 0,
"stock_status": "outofstock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"low_stock_amount": "",
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_class": "",
"shipping_class_id": 0,
"image": null,
"attributes": [
{
"id": 1,
"name": "color",
"option": "Orange"
}
],
"menu_order": 2,
"meta_data": [],
"purchase_price": null,
"supplier_id": null,
"supplier_sku": "",
"barcode": "",
"atum_controlled": true,
"out_stock_date": null,
"out_stock_threshold": null,
"inbound_stock": null,
"stock_on_hold": 0,
"sold_today": 0,
"sales_last_days": 0,
"reserved_stock": null,
"customer_returns": null,
"warehouse_damage": null,
"lost_in_post": null,
"other_logs": null,
"out_stock_days": 0,
"lost_sales": 0,
"update_date": "2021-04-21T05:39:48",
"atum_stock_status": "outofstock",
"low_stock": false,
"atum_stock_status": "outofstock",
"restock_status": false,
"sales_update_date": "2021-04-21T05:39:48",
"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": false,
"is_bom": false,
"mi_inventories": [],
"multi_inventory": "global",
"parent_id": 2966,
"_links": {
"self": [
{
"href": "http://example.com/wp-json/wc/v3/products/2966/variations/2969"
}
],
"collection": [
{
"href": "http://example.com/wp-json/wc/v3/products/2966/variations"
}
],
"up": [
{
"href": "http://example.com/wp-json/wc/v3/products/2966"
}
]
}
},
{
"id": 2968,
"date_created": "2021-04-13T13:13:34",
"date_created_gmt": "2021-04-13T11:13:34",
"date_modified": "2021-04-13T13:20:12",
"date_modified_gmt": "2021-04-13T11:20:12",
"description": "",
"permalink": "http://example.com/product/testing-variation-fields/?attribute_pa_color=blue",
"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,
"on_sale": false,
"status": "publish",
"purchasable": false,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"tax_status": "taxable",
"tax_class": "",
"manage_stock": true,
"stock_quantity": 0,
"stock_status": "outofstock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"low_stock_amount": "",
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_class": "",
"shipping_class_id": 0,
"image": null,
"attributes": [
{
"id": 1,
"name": "color",
"option": "Blue"
}
],
"menu_order": 1,
"meta_data": [],
"purchase_price": null,
"supplier_id": null,
"supplier_sku": "",
"barcode": "",
"atum_controlled": true,
"out_stock_date": null,
"out_stock_threshold": null,
"inbound_stock": null,
"stock_on_hold": 0,
"sold_today": 0,
"sales_last_days": 0,
"reserved_stock": null,
"customer_returns": null,
"warehouse_damage": null,
"lost_in_post": null,
"other_logs": null,
"out_stock_days": 0,
"lost_sales": 0,
"update_date": "2021-04-21T05:39:48",
"atum_stock_status": "outofstock",
"low_stock": false,
"atum_stock_status": "outofstock",
"restock_status": false,
"sales_update_date": "2021-04-21T05:39:48",
"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": false,
"is_bom": false,
"mi_inventories": [],
"multi_inventory": "global",
"parent_id": 2966,
"_links": {
"self": [
{
"href": "http://example.com/wp-json/wc/v3/products/2966/variations/2968"
}
],
"collection": [
{
"href": "http://example.com/wp-json/wc/v3/products/2966/variations"
}
],
"up": [
{
"href": "http://example.com/wp-json/wc/v3/products/2966"
}
]
}
},
{
"id": 2889,
"date_created": "2021-02-02T09:36:01",
"date_created_gmt": "2021-02-02T08:36:01",
"date_modified": "2021-02-02T09:37:51",
"date_modified_gmt": "2021-02-02T08:37:51",
"description": "",
"permalink": "http://example.com/product/variable-test/?attribute_pa_color=purple",
"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,
"on_sale": false,
"status": "publish",
"purchasable": false,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"tax_status": "taxable",
"tax_class": "",
"manage_stock": "parent",
"stock_quantity": 0,
"stock_status": "outofstock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"low_stock_amount": "",
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_class": "",
"shipping_class_id": 0,
"image": null,
"attributes": [
{
"id": 1,
"name": "color",
"option": "Purple"
}
],
"menu_order": 3,
"meta_data": [],
"purchase_price": null,
"supplier_id": null,
"supplier_sku": "",
"barcode": "",
"atum_controlled": false,
"out_stock_date": null,
"out_stock_threshold": null,
"inbound_stock": null,
"stock_on_hold": 0,
"sold_today": 0,
"sales_last_days": 0,
"reserved_stock": null,
"customer_returns": null,
"warehouse_damage": null,
"lost_in_post": null,
"other_logs": null,
"out_stock_days": 0,
"lost_sales": 0,
"update_date": "2021-04-21T05:39:48",
"atum_stock_status": "outofstock",
"low_stock": false,
"atum_stock_status": "outofstock",
"restock_status": false,
"sales_update_date": "2021-04-21T05:39:48",
"calc_backorders": null,
"linked_bom": [],
"sync_purchase_price": false,
"bom_sellable": null,
"minimum_threshold": null,
"available_to_purchase": null,
"selling_priority": null,
"calculated_stock": null,
"is_bom": false,
"is_bom": false,
"mi_inventories": [],
"multi_inventory": "global",
"parent_id": 505,
"_links": {
"self": [
{
"href": "http://example.com/wp-json/wc/v3/products/505/variations/2889"
}
],
"collection": [
{
"href": "http://example.com/wp-json/wc/v3/products/505/variations"
}
],
"up": [
{
"href": "http://example.com/wp-json/wc/v3/products/505"
}
]
}
}
]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. If not set, the WordPress "Blog pages show at most" setting is used. |
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. |
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 variations 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 |
sku | string | Limit result set to products with a specific SKU. |
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_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 variations. Product Levels ATUM |
Update a product variation
This API lets you make changes to a product variation.
HTTP request
/wp-json/wc/v3/products/<product_id>/variations/<id>curl -X PUT https://example.com/wp-json/wc/v3/products/22/variations/23 \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"multi_inventory": "yes",
"inventory_sorting_mode": "bbe",
"inventory_iteration": "use_next",
"expirable_inventories": "yes",
"price_per_inventory": "yes"
}'{
"id": 23,
"date_created": "2013-06-07T12:44:57",
"date_created_gmt": "2013-06-07T10:44:57",
"date_modified": "2019-11-08T10:22:13",
"date_modified_gmt": "2019-11-08T09:22:13",
"description": "",
"permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=black",
"sku": "",
"price": null,
"regular_price": null,
"sale_price": null,
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"status": "publish",
"purchasable": true,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"tax_status": "taxable",
"tax_class": "",
"manage_stock": true,
"stock_quantity": 0,
"stock_status": "outofstock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_class": "",
"shipping_class_id": 0,
"image": {
"id": 29,
"date_created": "2013-06-07T12:45:30",
"date_created_gmt": "2013-06-07T10:45:30",
"date_modified": "2013-06-07T12:45:30",
"date_modified_gmt": "2013-06-07T10:45:30",
"src": "https://example.com/wp-content/uploads/2013/06/T_4_front1.jpg",
"name": "T_4_front",
"alt": ""
},
"attributes": [
{
"id": 1,
"name": "color",
"option": "Black"
}
],
"menu_order": 2,
"meta_data": [],
"purchase_price": 8,
"supplier_id": 399,
"supplier_sku": "",
"barcode": "",
"atum_controlled": true,
"out_stock_date": null,
"out_stock_threshold": 0,
"inbound_stock": 2,
"stock_on_hold": 3,
"sold_today": 0,
"sales_last_days": 2,
"reserved_stock": 0,
"customer_returns": 0,
"warehouse_damage": 0,
"lost_in_post": 0,
"other_logs": 0,
"out_stock_days": 0,
"lost_sales": 0,
"update_date": "2019-11-08T07:00:06",
"atum_stock_status": "outofstock",
"restock_status": false,
"sales_update_date": "2019-11-08T07:00:06",
"calc_backorders": 0,
"linked_bom": [
{
"bom_id": 551,
"bom_type": "raw_material",
"qty": 1,
"measure_unit": null
}
],
"sync_purchase_price": false,
"calculated_stock": 9,
"is_bom": false,
"mi_inventories": [
81
],
"multi_inventory": "yes",
"inventory_sorting_mode": "bbe",
"inventory_iteration": "use_next",
"expirable_inventories": "yes",
"price_per_inventory": "yes",
"show_write_off_inventories": "global",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/products/22/variations/23"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products/22/variations"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/products/22"
}
]
}
}Delete a product variation
This API helps you delete a product variation.
HTTP request
/wp-json/wc/v3/products/<product_id>/variations/<id>curl -X DELETE https://example.com/wp-json/wc/v3/products/22/variations/2131?force=true \
-u consumer_key:consumer_secret{
"id": 2131,
"date_created": "2019-11-08T09:00:34",
"date_created_gmt": "2019-11-08T08:00:34",
"date_modified": "2019-11-08T09:00:59",
"date_modified_gmt": "2019-11-08T08:00:59",
"description": "",
"permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=purple",
"sku": "",
"price": "9.00",
"regular_price": "9.00",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"status": "publish",
"purchasable": true,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"tax_status": "taxable",
"tax_class": "",
"manage_stock": "parent",
"stock_quantity": 0,
"stock_status": "outofstock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_class": "",
"shipping_class_id": 0,
"image": {
"id": 48,
"date_created": "2013-06-07T13:01:23",
"date_created_gmt": "2013-06-07T11:01:23",
"date_modified": "2013-06-07T13:01:23",
"date_modified_gmt": "2013-06-07T11:01:23",
"src": "https://example.com/wp-content/uploads/2013/06/hoodie_2_front.jpg",
"name": "hoodie_2_front",
"alt": ""
},
"attributes": [
{
"id": 1,
"name": "color",
"option": "Purple"
}
],
"menu_order": 0,
"meta_data": [],
"purchase_price": 6.5,
"supplier_id": 0,
"supplier_sku": "",
"barcode": "",
"atum_controlled": false,
"out_stock_date": null,
"out_stock_threshold": 0,
"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,
"update_date": "2019-11-08T07:00:59",
"atum_stock_status": "outofstock",
"restock_status": false,
"sales_update_date": "2019-11-08T07:00:59",
"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/22/variations/2131"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products/22/variations"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/products/22"
}
]
}
}Available parameters
| Parameter | Type | Description |
|---|---|---|
force | string | Required to be true, as resource does not support trashing. |
Batch update product variations
This API helps you to batch create, update and delete multiple product variations.
Note: By default it's limited to up to 100 objects to be created, updated or deleted.
HTTP request
/wp-json/wc/v3/products/<product_id>/variations/batchcurl -X POST https://example.com/wp-json/wc/v3/products/22/variations/batch \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"create": [
{
"regular_price": "10.00",
"atum_controlled": true,
"attributes": [
{
"id": 1,
"name": "color",
"option": "Purple"
}
]
},
{
"regular_price": "11.00",
"atum_controlled": true,
"attributes": [
{
"id": 1,
"name": "color",
"option": "Orange"
}
]
}
],
"update": [
{
"id": 24,
"supplier_id": 399,
"supplier_sku": "VARSKU"
}
],
"delete": [
2132
]
}'{
"create": [
{
"id": 2133,
"date_created": "2019-11-08T10:52:24",
"date_created_gmt": "2019-11-08T09:52:24",
"date_modified": "2019-11-08T10:52:24",
"date_modified_gmt": "2019-11-08T09:52:24",
"description": "",
"permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=purple",
"sku": "",
"price": "10.00",
"regular_price": "10.00",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"status": "publish",
"purchasable": true,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"tax_status": "taxable",
"tax_class": "",
"manage_stock": "parent",
"stock_quantity": 0,
"stock_status": "instock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_class": "",
"shipping_class_id": 0,
"image": {
"id": 25,
"date_created": "2013-06-07T12:45:14",
"date_created_gmt": "2013-06-07T10:45:14",
"date_modified": "2013-06-07T12:45:14",
"date_modified_gmt": "2013-06-07T10:45:14",
"src": "https://example.com/wp-content/uploads/2013/06/T_4_front.jpg",
"name": "T_4_front",
"alt": ""
},
"attributes": [
{
"id": 1,
"name": "color",
"option": "Purple"
}
],
"menu_order": 0,
"meta_data": [],
"purchase_price": 0,
"supplier_id": 0,
"supplier_sku": "",
"barcode": "",
"atum_controlled": true,
"out_stock_date": null,
"out_stock_threshold": 0,
"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,
"update_date": "2019-11-08T08:52:25",
"atum_stock_status": "instock",
"restock_status": false,
"sales_update_date": "2019-11-08T08:52:25",
"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/22/variations/2133"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products/22/variations"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/products/22"
}
]
}
},
{
"id": 2134,
"date_created": "2019-11-08T10:52:26",
"date_created_gmt": "2019-11-08T09:52:26",
"date_modified": "2019-11-08T10:52:26",
"date_modified_gmt": "2019-11-08T09:52:26",
"description": "",
"permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=orange",
"sku": "",
"price": "11.00",
"regular_price": "11.00",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"status": "publish",
"purchasable": true,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"tax_status": "taxable",
"tax_class": "",
"manage_stock": "parent",
"stock_quantity": 0,
"stock_status": "instock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_class": "",
"shipping_class_id": 0,
"image": {
"id": 25,
"date_created": "2013-06-07T12:45:14",
"date_created_gmt": "2013-06-07T10:45:14",
"date_modified": "2013-06-07T12:45:14",
"date_modified_gmt": "2013-06-07T10:45:14",
"src": "https://example.com/wp-content/uploads/2013/06/T_4_front.jpg",
"name": "T_4_front",
"alt": ""
},
"attributes": [
{
"id": 1,
"name": "color",
"option": "Orange"
}
],
"menu_order": 0,
"meta_data": [],
"purchase_price": 0,
"supplier_id": 0,
"supplier_sku": "",
"barcode": "",
"atum_controlled": true,
"out_stock_date": null,
"out_stock_threshold": 0,
"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,
"update_date": "2019-11-08T08:52:26",
"atum_stock_status": "instock",
"restock_status": false,
"sales_update_date": "2019-11-08T08:52:26",
"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/22/variations/2134"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products/22/variations"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/products/22"
}
]
}
}
],
"update": [
{
"id": 24,
"date_created": "2013-06-07T12:44:58",
"date_created_gmt": "2013-06-07T10:44:58",
"date_modified": "2019-11-08T10:52:27",
"date_modified_gmt": "2019-11-08T09:52:27",
"description": "",
"permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=green",
"sku": "",
"price": "20",
"regular_price": "20",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"status": "publish",
"purchasable": true,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"tax_status": "taxable",
"tax_class": "",
"manage_stock": true,
"stock_quantity": 4,
"stock_status": "instock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_class": "",
"shipping_class_id": 0,
"image": {
"id": 27,
"date_created": "2013-06-07T12:45:27",
"date_created_gmt": "2013-06-07T10:45:27",
"date_modified": "2013-06-07T12:45:27",
"date_modified_gmt": "2013-06-07T10:45:27",
"src": "https://example.com/wp-content/uploads/2013/06/T_3_front.jpg",
"name": "T_3_front",
"alt": ""
},
"attributes": [
{
"id": 1,
"name": "color",
"option": "Green"
}
],
"menu_order": 2,
"meta_data": [],
"purchase_price": 12,
"supplier_id": 399,
"supplier_sku": "VARSKU",
"barcode": "AAAAOOOOOOP",
"atum_controlled": true,
"out_stock_date": null,
"out_stock_threshold": 0,
"inbound_stock": 1,
"stock_on_hold": 0,
"sold_today": 0,
"sales_last_days": 0,
"reserved_stock": 0,
"customer_returns": 0,
"warehouse_damage": 0,
"lost_in_post": 1,
"other_logs": 1,
"out_stock_days": 0,
"lost_sales": 0,
"update_date": "2019-11-08T08:52:27",
"atum_stock_status": "instock",
"restock_status": false,
"sales_update_date": "2019-11-08T08:52:27",
"calc_backorders": 0,
"linked_bom": [],
"sync_purchase_price": false,
"is_bom": false,
"mi_inventories": [],
"multi_inventory": "no",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/products/22/variations/24"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products/22/variations"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/products/22"
}
]
}
}
],
"delete": [
{
"id": 2132,
"date_created": "2019-11-08T10:51:11",
"date_created_gmt": "2019-11-08T09:51:11",
"date_modified": "2019-11-08T10:51:11",
"date_modified_gmt": "2019-11-08T09:51:11",
"description": "",
"permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=purple",
"sku": "",
"price": "9.00",
"regular_price": "9.00",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"status": "publish",
"purchasable": true,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"tax_status": "taxable",
"tax_class": "",
"manage_stock": "parent",
"stock_quantity": 0,
"stock_status": "outofstock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_class": "",
"shipping_class_id": 0,
"image": {
"id": 48,
"date_created": "2013-06-07T13:01:23",
"date_created_gmt": "2013-06-07T11:01:23",
"date_modified": "2013-06-07T13:01:23",
"date_modified_gmt": "2013-06-07T11:01:23",
"src": "https://example.com/wp-content/uploads/2013/06/hoodie_2_front.jpg",
"name": "hoodie_2_front",
"alt": ""
},
"attributes": [
{
"id": 1,
"name": "color",
"option": "Purple"
}
],
"menu_order": 0,
"meta_data": [],
"purchase_price": 6.5,
"supplier_id": 0,
"supplier_sku": "",
"barcode": "",
"atum_controlled": true,
"out_stock_date": null,
"out_stock_threshold": 0,
"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,
"update_date": "2019-11-08T08:51:11",
"atum_stock_status": "outofstock",
"restock_status": false,
"sales_update_date": "2019-11-08T08:51:11",
"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/0/variations/2132"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products/0/variations"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/products/0"
}
]
}
}
]
}Batch update any variations
ATUMThis API helps you to batch create, update and delete multiple product variations and also mixing variations from distinct variables at the same time.
Every item must include the product_id of its parent variable product. It's needed to know where to create the new variations and, when updating or deleting, WooCommerce checks that each variation belongs to the specified product_id (otherwise, the item fails with an "Invalid ID" error). So the items to delete must be passed as objects with the id and product_id keys, as shown in the example below.
Note: By default it's limited to up to 100 objects to be created, updated or deleted.
HTTP request
/wp-json/wc/v3/atum/product-variations/batchcurl -X POST https://example.com/wp-json/wc/v3/atum/product-variations/batch \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"create": [
{
"product_id": 22,
"regular_price": "10.00",
"atum_controlled": true,
"attributes": [
{
"id": 1,
"name": "color",
"option": "Purple"
}
]
},
{
"product_id": 22,
"regular_price": "11.00",
"atum_controlled": true,
"attributes": [
{
"id": 1,
"name": "color",
"option": "Orange"
}
]
}
],
"update": [
{
"id": 24,
"product_id": 22,
"supplier_id": 399,
"supplier_sku": "VARSKU"
}
],
"delete": [
{"id": 2132, "product_id": 22}
]
}'{
"create": [
{
"id": 2133,
"date_created": "2019-11-08T10:52:24",
"date_created_gmt": "2019-11-08T09:52:24",
"date_modified": "2019-11-08T10:52:24",
"date_modified_gmt": "2019-11-08T09:52:24",
"description": "",
"permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=purple",
"sku": "",
"price": "10.00",
"regular_price": "10.00",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"status": "publish",
"purchasable": true,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"tax_status": "taxable",
"tax_class": "",
"manage_stock": "parent",
"stock_quantity": 0,
"stock_status": "instock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_class": "",
"shipping_class_id": 0,
"image": {
"id": 25,
"date_created": "2013-06-07T12:45:14",
"date_created_gmt": "2013-06-07T10:45:14",
"date_modified": "2013-06-07T12:45:14",
"date_modified_gmt": "2013-06-07T10:45:14",
"src": "https://example.com/wp-content/uploads/2013/06/T_4_front.jpg",
"name": "T_4_front",
"alt": ""
},
"attributes": [
{
"id": 1,
"name": "color",
"option": "Purple"
}
],
"menu_order": 0,
"meta_data": [],
"purchase_price": 0,
"supplier_id": 0,
"supplier_sku": "",
"barcode": "",
"atum_controlled": true,
"out_stock_date": null,
"out_stock_threshold": 0,
"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,
"update_date": "2019-11-08T08:52:25",
"atum_stock_status": "instock",
"restock_status": false,
"sales_update_date": "2019-11-08T08:52:25",
"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/22/variations/2133"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products/22/variations"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/products/22"
}
]
}
},
{
"id": 2134,
"date_created": "2019-11-08T10:52:26",
"date_created_gmt": "2019-11-08T09:52:26",
"date_modified": "2019-11-08T10:52:26",
"date_modified_gmt": "2019-11-08T09:52:26",
"description": "",
"permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=orange",
"sku": "",
"price": "11.00",
"regular_price": "11.00",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"status": "publish",
"purchasable": true,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"tax_status": "taxable",
"tax_class": "",
"manage_stock": "parent",
"stock_quantity": 0,
"stock_status": "instock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_class": "",
"shipping_class_id": 0,
"image": {
"id": 25,
"date_created": "2013-06-07T12:45:14",
"date_created_gmt": "2013-06-07T10:45:14",
"date_modified": "2013-06-07T12:45:14",
"date_modified_gmt": "2013-06-07T10:45:14",
"src": "https://example.com/wp-content/uploads/2013/06/T_4_front.jpg",
"name": "T_4_front",
"alt": ""
},
"attributes": [
{
"id": 1,
"name": "color",
"option": "Orange"
}
],
"menu_order": 0,
"meta_data": [],
"purchase_price": 0,
"supplier_id": 0,
"supplier_sku": "",
"barcode": "",
"atum_controlled": true,
"out_stock_date": null,
"out_stock_threshold": 0,
"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,
"update_date": "2019-11-08T08:52:26",
"atum_stock_status": "instock",
"restock_status": false,
"sales_update_date": "2019-11-08T08:52:26",
"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/22/variations/2134"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products/22/variations"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/products/22"
}
]
}
}
],
"update": [
{
"id": 24,
"date_created": "2013-06-07T12:44:58",
"date_created_gmt": "2013-06-07T10:44:58",
"date_modified": "2019-11-08T10:52:27",
"date_modified_gmt": "2019-11-08T09:52:27",
"description": "",
"permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=green",
"sku": "",
"price": "20",
"regular_price": "20",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"status": "publish",
"purchasable": true,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"tax_status": "taxable",
"tax_class": "",
"manage_stock": true,
"stock_quantity": 4,
"stock_status": "instock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_class": "",
"shipping_class_id": 0,
"image": {
"id": 27,
"date_created": "2013-06-07T12:45:27",
"date_created_gmt": "2013-06-07T10:45:27",
"date_modified": "2013-06-07T12:45:27",
"date_modified_gmt": "2013-06-07T10:45:27",
"src": "https://example.com/wp-content/uploads/2013/06/T_3_front.jpg",
"name": "T_3_front",
"alt": ""
},
"attributes": [
{
"id": 1,
"name": "color",
"option": "Green"
}
],
"menu_order": 2,
"meta_data": [],
"purchase_price": 12,
"supplier_id": 399,
"supplier_sku": "VARSKU",
"barcode": "AAAAOOOOOOP",
"atum_controlled": true,
"out_stock_date": null,
"out_stock_threshold": 0,
"inbound_stock": 1,
"stock_on_hold": 0,
"sold_today": 0,
"sales_last_days": 0,
"reserved_stock": 0,
"customer_returns": 0,
"warehouse_damage": 0,
"lost_in_post": 1,
"other_logs": 1,
"out_stock_days": 0,
"lost_sales": 0,
"update_date": "2019-11-08T08:52:27",
"atum_stock_status": "instock",
"restock_status": false,
"sales_update_date": "2019-11-08T08:52:27",
"calc_backorders": 0,
"linked_bom": [],
"sync_purchase_price": false,
"is_bom": false,
"mi_inventories": [],
"multi_inventory": "no",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/products/22/variations/24"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products/22/variations"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/products/22"
}
]
}
}
],
"delete": [
{
"id": 2132,
"date_created": "2019-11-08T10:51:11",
"date_created_gmt": "2019-11-08T09:51:11",
"date_modified": "2019-11-08T10:51:11",
"date_modified_gmt": "2019-11-08T09:51:11",
"description": "",
"permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=purple",
"sku": "",
"price": "9.00",
"regular_price": "9.00",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"status": "publish",
"purchasable": true,
"virtual": false,
"downloadable": false,
"downloads": [],
"download_limit": -1,
"download_expiry": -1,
"tax_status": "taxable",
"tax_class": "",
"manage_stock": "parent",
"stock_quantity": 0,
"stock_status": "outofstock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_class": "",
"shipping_class_id": 0,
"image": {
"id": 48,
"date_created": "2013-06-07T13:01:23",
"date_created_gmt": "2013-06-07T11:01:23",
"date_modified": "2013-06-07T13:01:23",
"date_modified_gmt": "2013-06-07T11:01:23",
"src": "https://example.com/wp-content/uploads/2013/06/hoodie_2_front.jpg",
"name": "hoodie_2_front",
"alt": ""
},
"attributes": [
{
"id": 1,
"name": "color",
"option": "Purple"
}
],
"menu_order": 0,
"meta_data": [],
"purchase_price": 6.5,
"supplier_id": 0,
"supplier_sku": "",
"barcode": "",
"atum_controlled": true,
"out_stock_date": null,
"out_stock_threshold": 0,
"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,
"update_date": "2019-11-08T08:51:11",
"atum_stock_status": "outofstock",
"restock_status": false,
"sales_update_date": "2019-11-08T08:51:11",
"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/0/variations/2132"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/products/0/variations"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc/v3/products/0"
}
]
}
}
]
}