# Get Membership v2.0Beta
The Get Membership endpoint retrieves the loyalty membership for a customer. A single membership record will be returned and will include the cards linked to the membership.
# Request
GET /v2.0/customers/{profileKey}/loyalty
# 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 Membership resource wrapped in an ApiResponse envelope.
# Response Body
The endpoint returns our ApiResponse envelope. The data
property of the response will contain a Membership resource.
# Sample
{
"message": "The operation succeeded!",
"notifications": [],
"data": {
"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"
}
]
}
}
# 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.