BizKitHub
DocsAPI ReferenceVoucher/bff/voucher/statistics
getVoucherAdmin BFF

/bff/voucher/statistics

Returns analytics and statistics for a specific voucher including total revenue generated, average order value, unique customer count, and usage breakdown by order status.

VouchergetBffVoucherStatistics

Parameters

1 query

Query parameters

· 1
codestringRequired

Voucher code to get statistics for.

ExampleSUMMER2024

Response schema

1 status code documented

200SuccessVoucher statistics or null.
object | null

Voucher statistics or null.

One of 2:
Variant 1

Voucher statistics object.

totalOrdersnumberRequired

Total number of orders that used this voucher.

totalRevenuestringRequired

Sum of all order totals where voucher was used.

averageOrderValuestringRequired

Average order value when voucher was used.

uniqueCustomersnumberRequired

Number of distinct customers who used the voucher.

firstUsedDateDate | string | string | number | nullRequired

First time the voucher was used.

One of 2:
Variant 1
Date | string | string | number
One of 4:
Variant 1
Date
Variant 2
stringdate-time
Variant 3
stringdate
Variant 4
number
Variant 2
null
lastUsedDateDate | string | string | number | nullRequired

Most recent usage of the voucher.

One of 2:
Variant 1
Date | string | string | number
One of 4:
Variant 1
Date
Variant 2
stringdate-time
Variant 3
stringdate
Variant 4
number
Variant 2
null
usageByStatusobjectRequired

Breakdown of voucher usage by order status type.

paidnumberRequired

Orders with paid/completed status.

pendingnumberRequired

Orders with pending/processing status.

cancellednumberRequired

Orders with cancelled/storno status.

remainingUsagenumber | nullRequired

Remaining uses before limit. Null if unlimited.

One of 2:
Variant 1
number
Variant 2
null
isExpiredbooleanRequired

Whether voucher validity period has ended.

isActivebooleanRequired

Computed effective active status.

daysUntilExpirationnumber | nullRequired

Days until expiration. Null if no expiration or already expired.

One of 2:
Variant 1
number
Variant 2
null
Variant 2
null

Null if voucher not found.

Response example

application/json
{
  "totalOrders": 0,
  "totalRevenue": "example_totalRevenue",
  "averageOrderValue": "example_averageOrderValue",
  "uniqueCustomers": 0,
  "usageByStatus": {
    "paid": 0,
    "pending": 0,
    "cancelled": 0
  },
  "isExpired": false,
  "isActive": false
}

Request example

GET /bff/voucher/statistics

get
curl -X GET "https://api.bizkithub.com/bff/voucher/statistics?code=SUMMER2024" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY"

Need an API key?

All BizKitHub public API endpoints require authentication via API key.

Get API Key