> For the complete documentation index, see [llms.txt](https://rymera.gitbook.io/advanced-coupons-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rymera.gitbook.io/advanced-coupons-api/coupons-v1-acfwp/virtual-coupons/retrieve-a-virtual-coupon.md).

# Retrieve a virtual coupon

### GE&#x54;**:** /wp-json/coupons/v1/virtualcoupons/‌{virtual\_coupon\_id} <a href="#post-wp-json-loyalty-program-v-1-customers-points-user_id" id="post-wp-json-loyalty-program-v-1-customers-points-user_id"></a>

{% tabs %}
{% tab title="Request" %}
**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`     |
| {% endtab %}     |          |         |         |                                                     |

{% tab title="Request Example" %}
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
```

{% endtab %}

{% tab title="Response Example" %}
**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
    }
}
```

{% endtab %}
{% endtabs %}
