# Loyalty API Resources v2.0Beta

Each resource used in the Loyalty API version 2.0 is listed below.

# Card

A representation of a loyalty card linked to a customer's loyalty membership.

Name Required Type Description
profileKey true guid The unique profile key for customer.
profileBrandGroupKey true string The profile brand group that the customer profile is assigned to.
cardNumber true string The unique card number for the card.
status true string The current status of the card.
lastUsedOn false date The date the card was last used.
balanceCurrency true date The currency for the balance on the card. Usually will be points but could be an actual currency for some brands.
cardBalance false number The current loyalty balance for the card.
createdOn true date The date the card was created.

# Sample

{
    "profileBrandGroupKey": "TEST-SPUR-PROFILE",
    "profileKey": "25b7726e-8416-4b13-a54a-b7fae6518b8g",
    "cardNumber": "8888880111000002",
    "cardType": "Digital",
    "status": "Active",
    "lastUsedOn": "2021-04-01T00:00:00Z",
    "balanceCurrency": "Points",
    "cardBalance": 0,
    "createdOn": "2021-09-20T07:15:36"
}

# Membership

A representation of a loyalty membership for a customer.

Name Required Type Description
profileKey true guid The unique profile key for customer.
profileBrandGroupKey true string The profile brand group that the customer profile is assigned to.
membershipNumber true string The loyalty membership number for the customer. Usually matches the active digital card number on the membership.
balanceCurrency true string The currency for the balance on the membership. Usually will be points but could be an actual currency for some brands.
accountBalance true string The current loyalty balance for the membership.
pointsToNextVoucher true string The number of points required for the customer to earn their next voucher.
cards true Card[] The list of loyalty cards for the membership.

# Sample

{
    "profileKey": "25b7726e-8416-5b13-a54a-b7fae6518b8g",
    "profileBrandGroupKey": "TEST-SPUR-PROFILE",
    "membershipNumber": "8888880111000002",
    "balanceCurrency": "Points",
    "accountBalance": 142,
    "pointsToNextVoucher": 4858,
    "cards": [
        {
            "profileBrandGroupKey": "TEST-SPUR-PROFILE",
            "profileKey": "25b7726e-8416-5b13-a54a-b7fae6518b8g",
            "cardNumber": "8888880111000002",
            "cardType": "Digital",
            "status": "Active",
            "lastUsedOn": "2021-06-04T00:00:00Z",
            "balanceCurrency": "Points",
            "cardBalance": 41,
            "createdOn": "2021-01-20T07:15:36"
        },
        {
            "profileBrandGroupKey": "TEST-SPUR-PROFILE",
            "profileKey": "25b7726e-8416-5b13-a54a-b7fae6518b8g",
            "cardNumber": "7777770032554241",
            "cardType": "Physical",
            "status": "Inactive",
            "lastUsedOn": "2020-12-11T00:00:00Z",
            "balanceCurrency": "Points",
            "cardBalance": 101,
            "createdOn": "2019-07-13T00:00:00"
        }
    ]
}

# Voucher

A representation of a loyalty voucher.

Name Required Type Description
code true string The unique voucher code.
name true string A name for the voucher.
voucherType true string The voucher type to indicate if the voucher is a points voucher the customer earned or a coupon that the customer was given.
category true string The voucher category.
description true string A formatted representation of the address.
currency true string The currency for the voucher. Usually an actual currency but could be points in some cases.
currencySymbol false string The currency symbol for the voucher if the currency is an actual currency.
amount true string The voucher amount. This is cents if the currency is an actual currency and points if the voucher is points.
amountFormatted false string A formatted value for the voucher amount.
status true string The current status of the voucher.
expiresOn true string The date the voucher expires.

# Sample

{
    "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": "2022-01-01T00:00:00"
}