GET: /wp-json/coupons/v1/virtualcoupons/{virtual_coupon_id}
Requirements:
user role with manage_woocommerce
user capability
Get virtual coupon with id 31
GET: http://example.com/wp-json/coupons/v1/virtualcoupons/31
Get virtual coupon with id 31, with custom date format
GET: http://example.com/wp-json/coupons/v1/virtualcoupons/31?date_format=Y-m-d H:i:s
Status: 200 OK
Get virtual coupon
{
"key": "31",
"id": 31,
"code": "4ZFJUPJEMS",
"main_code": "bogo1",
"coupon_code": "bogo1-4zfjupjems",
"status": "pending",
"coupon_id": 207,
"user_id": 1,
"user_fullname": "Test Test",
"user_email": "junix@acfw.test",
"date_created": "May 31, 2021 1:14 pm",
"date_expire": ""
}
Get virtual coupon with custom date format
{
"key": "31",
"id": 31,
"code": "4ZFJUPJEMS",
"main_code": "bogo1",
"coupon_code": "bogo1-4zfjupjems",
"status": "pending",
"coupon_id": 207,
"user_id": 1,
"user_fullname": "Test Test",
"user_email": "junix@acfw.test",
"date_created": "2021-05-31 13:14:46",
"date_expire": ""
}
Status: 403 Forbidden
{
"code": "rest_forbidden_context",
"message": "Sorry, you are not allowed access to this endpoint.",
"data": {
"status": 401
}
}