> 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/loyalty-program-v1-lpfw-1/dashboard.md).

# Dashboard

The admin dashboard API allows you to fetch the overall points status, points sources and top customers data.

### GE&#x54;**:** /wp-json/wc-loyalty-program/v1/dashboard

{% tabs %}
{% tab title="Request" %}
**Requirements:**

* Logged-in user
* user role with `manage_woocommerce` user capability

| Method | Endpoint                                 |
| ------ | ---------------------------------------- |
| GET    | /wp-json/wc-loyalty-program/v1/dashboard |

| Query Parameters | Required | Type | Description |
| ---------------- | -------- | ---- | ----------- |
|                  |          |      |             |
| {% endtab %}     |          |      |             |

{% tab title="Request Example" %}
Get dashboard data

```
GET: http://example.com/wp-json/wc-loyalty-program/v1/dashboard
```

{% endtab %}

{% tab title="Response Example" %}
**Status: 200 OK**

```
{
    "status": [
        {
            "label": "Total Points (All Time)",
            "points": 4957,
            "value": "$49.57"
        },
        {
            "label": "Unclaimed Points",
            "points": 2972,
            "value": "₱29.72"
        },
        {
            "label": "Claimed Points",
            "points": 1985,
            "value": "₱19.85"
        },
        {
            "label": "Expired Points",
            "points": 0,
            "value": "₱0,00"
        }
    ],
    "sources": [
        {
            "label": "Purchasing products",
            "points": 1937
        },
        {
            "label": "Leaving a product review",
            "points": 55
        },
        {
            "label": "Commenting on a blog post",
            "points": 25
        },
        {
            "label": "Registering as a user/customer",
            "points": 40
        },
        {
            "label": "After completing first order",
            "points": 0
        },
        {
            "label": "Spending over a certain amount",
            "points": 950
        },
        {
            "label": "Extra points during a period",
            "points": 1100
        }
    ],
    "customers": [
        ...
        {
            "id": 17,
            "name": "John Smith",
            "email": "johnsmith@example.com",
            "points": 945
        },
        ...
    ]
}
```

**Status: 401 Unauthorized**

```
{
    "code": "rest_forbidden_context",
    "message": "Sorry, you are not allowed access to this endpoint.",
    "data": {
        "status": 401
    }
}
```

{% endtab %}
{% endtabs %}
