Variations
The wholesale role API allows you to create, view, update, and delete wholesale variations.
Note:
You can still use wc product properties set in WC API since our API is just extending from WC.
You need to create the variable parent first via
wholesale/v1/products
endpoint before you can use this endpoint.
Available Routes:
GET: wholesale/v1/products/{variable_id}/variations
GET: wholesale/v1/products/{variable_id}/variations/{variation_id}
POST: wholesale/v1/products/{variable_id}/variations
PUT: wholesale/v1/products/{variable_id}/variations/{variation_id}
DELETE: wholesale/v1/products/{variable_id}/variations/{variation_id}
POST: wholesale/v1/products/{variable_id}/variations/batch
Wholesale Data Property
To get wholesale related data, it can be accessed using the property wholesale_data
in the response.
Ex. Request:
GET: http://example.com/wp-json/wholesale/v1/products/4303/variations/4306?wholesale_role=wholesale_customer
Ex. Response:
Note: The price_html
data will only show up if wholesale role is provided. The price_html
contains the regular + wholesale price in html format. If not a wholesale product, it will show the regular price in html format.
Last updated