Get dashboard statistics data
GET: /wp-json/wc-store-credits/v1/customers/status
Requirements:
Logged-in user
user role with
manage_woocommerceuser capability
Method
Endpoint
GET
/wp-json/wc-store-credits/v1/customers/status
Query Parameters
Required
Type
Default
Description
startPeriod
no
string
first day of the current month at 00:00:00 time
Start date period value of statistics to query. Date value should be in mysql date format (Y-m-d H:i:s)
endPeriod
no
string
Current date and time
End date period value of statistics to query. Date value should be in mysql date format (Y-m-d H:i:s)
Get statistics from the start of the month to current date
GET: http://example.com/wp-json/wc-store-credits/v1/customers/statusStatus: 200 OK
Get statistics from the start of the month to current date
[
{
"key": "unclaimed",
"label": "Unclaimed",
"amount_raw": 420.5,
"amount": "$420.50"
},
{
"key": "added_in_period",
"label": "Added in Period",
"amount_raw": 623.25,
"amount": "$623.25"
},
{
"key": "used_in_period",
"label": "Used in Period",
"amount_raw": 283,
"amount": "$283.00"
}
]Status: 403 Forbidden
{
"code": "rest_forbidden_context",
"message": "Sorry, you are not allowed access to this endpoint.",
"data": {
"status": 401
}
}Last updated
Was this helpful?