If you manage wholesale pricing outside WordPress, you can do most of it over HTTP instead of in the admin. The Wholesale Suite API extends the WooCommerce REST API so you can read and write wholesale products, variations, roles, discounts and analytics from your own code. This article lists what each endpoint group covers, which plugin provides it, and where to find the full reference.
Requirements
- WooCommerce Wholesale Prices 1.12 or later. The batch endpoints need 1.16 or later.
- The wholesale product, variation and role endpoints ship with WooCommerce Wholesale Prices, the free plugin. You do not need WooCommerce Wholesale Prices Premium for them.
- WooCommerce Wholesale Prices Premium 1.27 or later, for the wholesale discount endpoints. The Premium API arrived in version 1.25, and the category and general discount endpoints arrived in 1.27. The analytics endpoints also need Premium.
- WooCommerce Wholesale Lead Capture 2.0 or later, for the lead endpoints.
Wholesale Suite introduces a dedicated endpoint: wholesale/v1/ and wwlc/v1. These endpoints give you the flexibility to interact with and manage key aspects of your wholesale store programmatically.
Key features of the Wholesale Suite API
- Wholesale products: list, create, update, or delete wholesale products. Update many at once with the batch endpoint, wholesale/v1/products/batch, which needs WooCommerce Wholesale Prices 1.16 or later.
- Wholesale variations: list, create, update, or delete the variations of a product. The batch endpoint is wholesale/v1/products/{product_id}/variations/batch.
- Wholesale roles: list and update the roles that control who gets which pricing. The free plugin ships one wholesale role, and Premium adds create and delete.
- Wholesale leads: list, create, update, or delete wholesale leads. These endpoints come with WooCommerce Wholesale Lead Capture and use the wwlc/v1 namespace.
- Wholesale discounts: read and set category level and general discounts through the category-discount and general-discount endpoints. These need WooCommerce Wholesale Prices Premium 1.27 or later.
- Wholesale analytics: retrieve wholesale sales metrics for products, customers, or general wholesale purchases. These sit in their own namespace, wholesale/v1/analytics, and need Premium.
Why use the Wholesale Suite API
This API integration makes managing your wholesale store more flexible and seamless, especially if you need to automate or sync your wholesale data with other systems or platforms. Whether you’re managing large catalogs, adjusting prices in bulk, or customizing user roles, this API allows you to do it all without having to manually adjust each setting in your admin dashboard.
Getting started with the Wholesale Suite API
To interact with the Wholesale Suite API, use WordPress REST API Authentication and standard HTTP verbs (GET, POST, PUT, DELETE). You can integrate this functionality with any platform or system that supports HTTP-based API requests.
For complete details on using the Wholesale Suite API, including available methods, parameters, and example requests, please refer to the full API documentation.
REST API trigger action allowlist
Wholesale Suite has a second endpoint for running maintenance actions, such as clearing product caches. It sits in the wwp/v1 namespace, not wholesale/v1, so it is easy to miss.
Send a POST request to /wp-json/wwp/v1/admin/action with an action value in the body. The request needs administrator access.
Every action name has to be on an allowlist. If it is not, the response comes back with a status of error and the message Invalid action. An allowed action runs its handler and returns a status and a message.
These action names are available when the matching plugin is active:
- WooCommerce Wholesale Prices Premium: clear_var_prod_price_range_caching, clear_product_caching, clear_unused_product_meta, initialize_product_visibility_meta, force_fetch_update_data
- WooCommerce Wholesale Lead Capture: force_fetch_update_data, create_lead_pages
- WooCommerce Wholesale Order Form: schedule_database_optimization
To add your own action, register it with the wwp_allowed_trigger_actions filter in PHP. Wholesale Suite also picks up any hook whose name starts with wwp_trigger_ and treats the rest of the name as an allowed action. You cannot add an action name over the REST API itself.
add_filter( 'wwp_allowed_trigger_actions', function ( $actions ) {
$actions[] = 'my_custom_action';
return $actions;
} );
add_filter( 'wwp_trigger_my_custom_action', function ( $params ) {
// Run your task here.
return array(
'status' => 'success',
'message' => 'Custom action finished.',
);
} );
There is a second, separate allowlist for group settings actions. It uses the wwp_allowed_group_actions filter and runs on the settings save endpoint, /wp-json/wwp/v1/admin/save. If your action saves settings, it belongs on that list instead.
Help & Support
We have a dedicated support team for Wholesale Suite who knows our products, WooCommerce, and the industry very well. You’re welcome to make use of their expertise at any time, worldwide.
If you are an existing customer, please go to the support ticket request form and send us a message.
If you are a free plugin user, please send us a support request on the forum. We actively monitor the WordPress.org support forums for the free plugin and help our users there as best as we can.
