Create a virtual coupon
POST: /wp-json/coupons/v1/virtualcoupons/
Requirements:
Logged-in user
user role with
manage_woocommerceuser capability
Method
Endpoint
POST
/wp-json/coupons/v1/virtualcoupons/
Query Parameters
Required
Type
Description
coupon_id
yes
integer
Coupon ID
status
no
string
Valid virtual coupon status: pending or used
date_created
no
string
Date and time of virtual coupon was created
date_expire
no
string
Date and time for virtual coupon to be marked as expired.
user_id
no
integer
Customer ID
date_format
no
string
Date format of the provided date values. Default: Y-m-d H:i:s
Create virtual coupon
POST: http://example.com/wp-json/coupons/v1/virtualcoupons/
JSON Body:
{
"coupon_id": 207
}Create virtual coupon with date expire
POST: http://example.com/wp-json/coupons/v1/virtualcoupons/
JSON Body:
{
"coupon_id": 207,
"date_expire": "January 1, 2022 10:00 am",
"date_format": "F j, Y g:i a"
}Status: 200 OK
Create Virtual Coupon
Create virtual coupon with date expire
Status: 403 Forbidden
Last updated
Was this helpful?