# Discover Loyalty Vouchers v2.0Beta

The Discover Loyalty Vouchers endpoint retrieves loyalty vouchers for a customer from our loyalty provider. The cart is submitted to the provider and is evaluated to check what vouchers, coupons and other rewards are available to the customer based on the customer profile and the contents of the cart.

These vouchers can be used to add discounts for the cart using the Add Loyalty Discount endpoint.

The list of vouchers returned may vary based on the contents of the cart, the customer placing the order and other factors. Whilst the List Vouchers endpoint may return all vouchers linked to the customers profile, including redeemed and recently expired ones, this endpoint will only return the vouchers that may be used on the cart.

Expired vouchers and linked vouchers not applicable to the ordering or fulfilment channels for the cart will not be returned.

# Request

POST /v2.0/customers/{profileKey}/carts/{cartId}/discovery/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.
cartId true guid The cart id for the cart.

# Response

200
OK
Returns 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": "Active",      
      "expiresOn": "2022-07-01T00:00:00"
    }
  ]
}

# Errors

The standard error responses apply.

400
Bad Request
When the request fails validation.
401
Unauthorized
When authentication fails.
403
Forbidden
When authorisation fails.
404
Not Found
When the cart cannot be found.