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)

Retrieve a virtual coupon

GET: /wp-json/coupons/v1/virtualcoupons/‌{virtual_coupon_id}

Requirements:

  • Logged-in user

  • user role with manage_woocommerce user capability

Method

Endpoint

GET

/wp-json/coupons/v1/virtualcoupons/‌{virtual_coupon_id}

Query Parameters

Required

Type

Default

Description

​date_format

​no

​string

Date format of virtual coupon response date values.

context

no

string

edit

Context of data being fetched: view or edit

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
    }
}
PreviousCreate a virtual couponNextUpdate a virtual coupon

Last updated 3 years ago

Was this helpful?