Create a Wholesale Product
This API handles creating a wholesale product.
Method
Endpoint
POST
/wp-json/wholesale/v1/products/
Body Parameters
Required
Type
Description
wholesale_price
yes
array
The wholesale price.
wholesale_sale_price
no
array
The wholesale sale price.
Postman
Creating wholesale simple product
POST: /wp-json/wholesale/v1/products/
JSON Body:
{
"name" : "Premium Quality",
"type" : "simple",
"regular_price" : "21.99",
"wholesale_price" : {
"wholesale_customer" : "12"
}
// With sale price.
"wholesale_sale_price" : {
"wholesale_customer" : "10"
}
}Creating a wholesale variable product
POST: /wp-json/wholesale/v1/products/
JSON Body:
{
"name" : "Ship Your Idea",
"type" : "variable",
"attributes" : [
{
"name" : "Size",
"position" : 0,
"visible" : true,
"variation" : true,
"options" : [
"S",
"M"
]
}
]
}Note:
Since v1.16, it is now allowed to create both non-wholesale and wholesale products. Meaning providing wholesale_price is optional.
Last updated
Was this helpful?