Create a Wholesale Variation
This API handles creating wholesale and non-wholesale variation.
Method
Endpoint
POST
/wp-json/wholesale/v1/products/{variable_id}/variations
Path parameters
Required
Type
Description
variable_id
yes
int
The variable ID.
Body Parameters
Required
Type
Description
wholesale_price
no
array
Wholesale prices for each wholesale role.
wholesale_sale_price
no
array
Wholesale sale prices for each wholesale role.
Postman
Creating wholesale variation
POST: /wp-json/wholesale/v1/products/{variable_id}/variations
JSON Body:
{
"regular_price": "19.00",
"attributes": [
{
"id": 1,
"name": "Color",
"option": "Black"
}
],
"wholesale_price": {
"wholesale_customer": "12"
},
// With sale price.
"wholesale_sale_price": {
"wholesale_customer": "10"
}
}Last updated
Was this helpful?