Advanced Coupons API
  • REST API
  • coupons/v1
    • Virtual Coupons (Premium)
      • Query a list of virtual coupons
      • Fetch virtual coupon stats
      • Create a virtual coupon
      • Retrieve a virtual coupon
      • Update a virtual coupon
      • Delete a virtual coupon
      • Bulk create virtual coupons
      • Bulk delete virtual coupons
    • Search Customers (Premium)
    • Settings
  • loyalty-program/v1
    • Dashboard
    • Customers
    • Settings
    • My Points
  • wc-loyalty-program/v1
    • Dashboard
    • Customers
    • Settings
  • wc-store-credits/v1
    • Entries
      • Query a list of store credit entries
      • Create a store credit entry
      • Fetch a single store credit entry
      • Update store credit entry
      • Delete store credit entry
    • Customers
      • Get dashboard statistics data
      • Query list of customers with store credits balance
      • Get single customer statistics and sources
Powered by GitBook
On this page

Was this helpful?

  1. coupons/v1
  2. Virtual Coupons (Premium)

Bulk create virtual coupons

POST: /wp-json/coupons/v1/bulk/virtualcoupons/‌

Requirements:

  • Logged-in user

  • user role with manage_woocommerce user 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
    }
}
PreviousDelete a virtual couponNextBulk delete virtual coupons

Last updated 3 years ago

Was this helpful?