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. wc-loyalty-program/v1

Dashboard

/wp-json-loyalty-program/v1/dashboard

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

GET: /wp-json/wc-loyalty-program/v1/dashboard

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

Get dashboard data

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

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
    }
}

Previouswc-loyalty-program/v1NextCustomers

Last updated 2 years ago

Was this helpful?