Bulk create virtual coupons
POST: /wp-json/coupons/v1/bulk/virtualcoupons/
Requirements:
Logged-in user
user role with
manage_woocommerceuser capability
Method
Endpoint
POST
/wp-json/coupons/v1/bulk/virtualcoupons/
Query Parameters
Required
Type
Description
coupon_id
yes
integer
Coupon ID
count
yes
integer
Number of virtual coupons to be created. Max: 10000 per call.
Bulk create virtual coupons
POST: http://example.com/wp-json/coupons/v1/bulk/virtualcoupons/
JSON Body:
{
"coupon_id": 207,
"count": 100
}Status: 200 OK
Bulk create virtual coupons
{
"message": "100 new virtual coupon codes have been generated for this coupon.",
"count": 100,
"total": 154
}Status: 403 Forbidden
{
"code": "rest_forbidden_context",
"message": "Sorry, you are not allowed access to this endpoint.",
"data": {
"status": 401
}
}Last updated
Was this helpful?