Reports

Voucher codes report

A paginated list of voucher codes issued at the given site, with filtering by status, code, face amount, balance, expiry date and creation date. Money values are integers in minor units. For large exports, use /shop/reports/voucher-codes/queue.

get/shop/reports/voucher-codes

Query parameters

site_idstring uuid required

The site to list voucher codes for.

pageinteger

The page to retrieve results from

per_pageinteger

The number of voucher codes to return per page (1-100). Defaults to 30.

codestring

Filter to voucher codes containing this substring (case-insensitive).

statusstring[]

A comma-separated list of voucher code statuses to filter on.

amountstring
Example:>=10000

Filter by code face amount (in minor units). Supports a comparison operator prefix, e.g. >=10000, <5000, =2000, or a bare value (interpreted as equality).

balancestring

Filter by remaining code balance (in minor units), using the same operator syntax as amount.

voucher_type_idstring[]

A comma-separated list of voucher type IDs to filter on.

fulfillment_statusstring

Filter by voucher fulfillment status.

created_sincestring date-time

Filter to voucher codes created on or after this date-time.

expired_range_fromstring date

Filter to voucher codes whose expiry date falls on or after this date.

expired_range_tostring date

Filter to voucher codes whose expiry date falls strictly before this date.

Response

The voucher codes were successfully retrieved.

Example response

{
  "data": [
    {
      "code": "TRYBE-ABC123",
      "status": "issued",
      "amount_type": "monetary",
      "amount": 5000,
      "balance": 5000,
      "currency": "gbp",
      "voucher_type": {
        "name": "£50 Spa Day Voucher"
      }
    }
  ],
  "meta": {
    "from": 1,
    "to": 2,
    "total": 2,
    "current_page": 1,
    "last_page": 2,
    "per_page": 15,
    "path": "http://example.com/api"
  },
  "links": {
    "first": "http://example.com?page=1",
    "next": "https://example.com?page=3",
    "prev": "https://example.com?page=1",
    "last": "https://example.com?page=4"
  }
}

Changes