Create a Wholesale Product
This endpoint allows you to create wholesale product.
POST | /wp-json/wholesale/v1/products |
Body Parameters | Required | Type | Description |
wholesale_price | no | array | Wholesale prices for each wholesale role. |
categories | no | array | Wholesale Category IDs. This is needed to attach a proper wholesale meta data flag for the product. |
wholesale_visibility_filter | no | array | The wholesale role keys that allowed to see the product. |
ignore_cat_level_wholesale_discount | no | array | The "Disregard Product Category Level Wholesale Discount" option. |
ignore_role_level_wholesale_discount | no | array | The "Disregard Wholesale Role Level Wholesale Discount" option. |
wholesale_minimum_order_quantity | no | array | The "Wholesale Minimum Order Quantity" for each role |
wholesale_order_quantity_step | no | array | The "Wholesale Order Quantity Step" for each |
wholesale_quantity_discount_rule_mapping | no | array | The rules for "Product Quantity Based Wholesale Pricing" option. |
Extra Properties for wholesale_quantity_discount_rule_mapping
Properties | Type | Description |
---|---|---|
wholesale_role | String | The wholesale role key |
start_qty | Number | The min quantity of the quantity range in order to trigger the wholesale discount. |
end_qty | Number | The max quantity of the quantity range in order to trigger the wholesale discount. |
price_type | String | Either percent-price or fixed-price |
wholesale_price | Number | The wholesale price/discount. |
Note:
Since v1.27, it is now allowed to create both non-wholesale and wholesale products. Meaning providing wholesale_price is optional.
To disable the "Product Quantity Based Wholesale Pricing" option, set the value to empty string. Ex.
wholesale_quantity_discount_rule_mapping: ""
Possible values for
price_type
arepercent-price
orfixed-price
.
Last updated