# List Vouchers v2.0Beta

The List Vouchers endpoint retrieves a list of loyalty vouchers for a customer. A list of all the vouchers for the customer for the past 12 months will be returned. This will include active vouchers and vouchers that have expired or have been redeemed.

# Request

GET /v2.0/customers/{profileKey}/loyalty/vouchers

# Authorization

An OAuth 2.0 Bearer token with the Loyalty.Read scope is required. For more information, see Authentication.

# Path Parameters

A list of the supported path parameters is described below.

Name Required Type Description
profileKey true guid The profile key for the customer. This value can be retrieved from the profileKey claim in the token returned from our SSO solution.

# Response

200
OK
Returns a Voucher resource wrapped in an ApiListResponse envelope.

# Response Body

The endpoint returns our ApiListResponse envelope. The data property of the response will contain an array of Voucher resources.

# Sample

{
  "message": "The operation succeeded! 2 records returned.",
  "notifications": [],
  "numberOfRecords": 2,
  "totalRecords": 0,
  "data": [
    {
      "code": "8888880200001964",
      "name": "Points Earned Voucher",
      "voucherType": "PointsVoucher",
      "category": "Category",
      "description": "Description here...",
      "currency": "ZAR",
      "currencySymbol": "R",
      "amount": 5000,
      "amountFormatted": "R 50.00",
      "status": "Active",
      "expiresOn": "2025-01-01T00:00:00"
    },
    {
      "code": "8888880200001967",
      "name": "Birthday Voucher",
      "voucherType": "BirthdayVoucher",
      "category": "Category",
      "description": "Birthday Voucher...",
      "currency": "ZAR",
      "currencySymbol": "R",
      "amount": 6500,
      "amountFormatted": "R 65.00",
      "status": "Expired",      
      "expiresOn": "2022-01-01T00:00:00"
    }
  ]
}

# Errors

The standard error responses apply.

401
Unauthorized
When authentication fails.
403
Forbidden
When authorisation fails.
404
Not Found
When the customer profile cannot be found.