Delete a Wholesale Variation
This API handles deleting a wholesale or non-wholesale variation.
Method
Endpoint
DELETE
/wp-json/wholesale/v1/products/{variable_id}/variations/{variation_id}
Path parameters
Required
Type
Description
variable_id
yes
integer
The variable product ID.
variation_id
yes
integer
The variation ID.
Status: 200 OK
Variation Deleted
DELETE: /wp-json/wholesale/v1/products/{variable_id}/variations/{variation_id}
Response:
{
"id": 4305,
"date_created": "2021-03-15T05:47:31",
"date_created_gmt": "2021-03-15T05:47:31",
"date_modified": "2021-03-15T05:53:44",
"date_modified_gmt": "2021-03-15T05:53:44",
"description": "",
"permalink": "https://example.com/product/ship-your-idea-variable-2/?attribute_size=S",
"sku": "",
"price": "120",
"regular_price": "120",
"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": false,
"stock_quantity": null,
"stock_status": "instock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"weight": "",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_class": "",
"shipping_class_id": 0,
"image": null,
"attributes": [
{
"id": 0,
"name": "Size",
"option": "S"
}
],
"menu_order": 0,
"wholesale_data": {
"wholesale_price": {
"wholesale_customer": "6"
}
}
}Note:
Able to delete wholesale or non-wholesale variation.
Deleting variation via this API endpoint will force delete the variation. This fixes the issue when variable product is restored, it will pair again with the deleted variation.
Last updated
Was this helpful?